mod_Forum/discussion_nested_v2

Module for viewing a discussion in nested v2 view.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Members

(static, constant) init

Source:

Initialise the javascript for the discussion in nested v2 display mode.

(inner) showInPageReplyForm

Source:

Variable to hold the showInPageReplyForm function after it's built.

Methods

(inner) buildShowInPageReplyFormFunction(additionalTemplateContext) → {function}

Source:

Build the showInPageReplyForm function with the given additional template context.

Parameters:
Name Type Description
additionalTemplateContext Object

Additional render context for the in page reply template.

Returns:
Type
function

(inner) getHideRepliesButton(replyVisibilityToggleContainer) → {Object}

Source:

Get the hide replies button element from the replies visibility toggle container element.

Parameters:
Name Type Description
replyVisibilityToggleContainer Object

jQuery element for the toggle container

Returns:

jQuery element

Type
Object

(inner) getInPageReplyContainer(postContainer) → {Object}

Source:

Get the in page reply container element from the post container element.

Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getInPageReplyCreateButton(postContainer) → {Object}

Source:

Get the in page reply create (reply) button element from the post container element.

Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getInPageReplyForm(postContainer) → {Object}

Source:

Get the in page reply form element from the post container element.

Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getParentPostContainers(element) → {Object}

Source:

Get the parent post container elements from the given element.

Parameters:
Name Type Description
element Object

jQuery element to search from

Returns:

jQuery element

Type
Object

(inner) getPostContainer(element) → {Object}

Source:

Get the closest post container element from the given element.

Parameters:
Name Type Description
element Object

jQuery element to search from

Returns:

jQuery element

Type
Object

(inner) getPostContainerById(element, id) → {Object}

Source:

Get the closest post container element from the given element.

Parameters:
Name Type Description
element Object

jQuery element to search from

id Number

Id of the post to find.

Returns:

jQuery element

Type
Object

(inner) getPostContentContainer(postContainer) → {Object}

Source:

Get the post content container element from the post container element.

Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getRepliesContainer(postContainer) → {Object}

Source:

Get the replies container element from the post container element.

Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getRepliesVisibilityToggleContainer(postContainer) → {Object}

Source:

Get the replies visibility toggle container (show/hide replies button container) element from the post container element.

Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getShowRepliesButton(replyVisibilityToggleContainer) → {Object}

Source:

Get the show replies button element from the replies visibility toggle container element.

Parameters:
Name Type Description
replyVisibilityToggleContainer Object

jQuery element for the toggle container

Returns:

jQuery element

Type
Object

(inner) hasInPageReplyForm(inPageReplyContainer) → {Bool}

Source:

Check if the in page reply container contains the in page reply form.

Parameters:
Name Type Description
inPageReplyContainer Object

jQuery element for the in page reply container

Returns:
Type
Bool

(inner) hasReplies(postContainer) → {Bool}

Source:

Check if the post has any replies.

Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:
Type
Bool

(inner) hideInPageReplyForm(postContainer, postIdToSee)

Source:

Hide the in page reply form in the given in page reply container. The form display will be animated.

Parameters:
Name Type Default Description
postContainer Object

jQuery element for the post container

postIdToSee Number | null null

Id of the post to scroll into view (if any)

(inner) hideReplies(postContainer)

Source:

Hide the post replies.

Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

(inner) incrementTotalReplyCount(postContainer)

Source:

Increment the total reply count in the show/hide replies buttons for the post.

Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

(inner) registerEventListeners(root)

Source:

Create all of the event listeners for the discussion.

Parameters:
Name Type Description
root Object

jQuery element for the discussion container

(inner) renderInPageReplyTemplate(additionalTemplateContext, button, postContainer) → {Object}

Source:

Render the template to generate the in page reply form HTML.

Parameters:
Name Type Description
additionalTemplateContext Object

Additional render context for the in page reply template

button Object

jQuery element for the reply button that was clicked

postContainer Object

jQuery element for the post container

Returns:

jQuery promise

Type
Object

(inner) repliesVisible(postContainer) → {Bool}

Source:

Check if the replies are visible.

Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:
Type
Bool

(inner) showReplies(postContainer, postIdToSee)

Source:

Show the post replies.

Parameters:
Name Type Default Description
postContainer Object

jQuery element for the post container

postIdToSee Number | null null

Id of the post to scroll into view (if any)