mod_Forum/discussion_nested_v2

Description:
  • Module for viewing a discussion in nested v2 view.

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

Module for viewing a discussion in nested v2 view.

Members

(static, constant) init

Description:
  • Initialise the javascript for the discussion in nested v2 display mode.

Source:

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

(inner) showInPageReplyForm

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

Source:

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

Methods

(inner) buildShowInPageReplyFormFunction(additionalTemplateContext) → {function}

Description:
  • Build the showInPageReplyForm function with the given additional template context.

Source:
Parameters:
Name Type Description
additionalTemplateContext Object

Additional render context for the in page reply template.

Returns:
Type
function

(inner) getHideRepliesButton(replyVisibilityToggleContainer) → {Object}

Description:
  • Get the hide replies button element from the replies visibility toggle container element.

Source:
Parameters:
Name Type Description
replyVisibilityToggleContainer Object

jQuery element for the toggle container

Returns:

jQuery element

Type
Object

(inner) getInPageReplyContainer(postContainer) → {Object}

Description:
  • Get the in page reply container element from the post container element.

Source:
Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getInPageReplyCreateButton(postContainer) → {Object}

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

Source:
Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getInPageReplyForm(postContainer) → {Object}

Description:
  • Get the in page reply form element from the post container element.

Source:
Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getParentPostContainers(element) → {Object}

Description:
  • Get the parent post container elements from the given element.

Source:
Parameters:
Name Type Description
element Object

jQuery element to search from

Returns:

jQuery element

Type
Object

(inner) getPostContainer(element) → {Object}

Description:
  • Get the closest post container element from the given element.

Source:
Parameters:
Name Type Description
element Object

jQuery element to search from

Returns:

jQuery element

Type
Object

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

Description:
  • Get the closest post container element from the given element.

Source:
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}

Description:
  • Get the post content container element from the post container element.

Source:
Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getRepliesContainer(postContainer) → {Object}

Description:
  • Get the replies container element from the post container element.

Source:
Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getRepliesVisibilityToggleContainer(postContainer) → {Object}

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

Source:
Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:

jQuery element

Type
Object

(inner) getShowRepliesButton(replyVisibilityToggleContainer) → {Object}

Description:
  • Get the show replies button element from the replies visibility toggle container element.

Source:
Parameters:
Name Type Description
replyVisibilityToggleContainer Object

jQuery element for the toggle container

Returns:

jQuery element

Type
Object

(inner) hasInPageReplyForm(inPageReplyContainer) → {Bool}

Description:
  • Check if the in page reply container contains the in page reply form.

Source:
Parameters:
Name Type Description
inPageReplyContainer Object

jQuery element for the in page reply container

Returns:
Type
Bool

(inner) hasReplies(postContainer) → {Bool}

Description:
  • Check if the post has any replies.

Source:
Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:
Type
Bool

(inner) hideInPageReplyForm(postContainer, postIdToSee)

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

Source:
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)

Description:
  • Hide the post replies.

Source:
Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

(inner) incrementTotalReplyCount(postContainer)

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

Source:
Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

(inner) registerEventListeners(root)

Description:
  • Create all of the event listeners for the discussion.

Source:
Parameters:
Name Type Description
root Object

jQuery element for the discussion container

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

Description:
  • Render the template to generate the in page reply form HTML.

Source:
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}

Description:
  • Check if the replies are visible.

Source:
Parameters:
Name Type Description
postContainer Object

jQuery element for the post container

Returns:
Type
Bool

(inner) showReplies(postContainer, postIdToSee)

Description:
  • Show the post replies.

Source:
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)