Module for viewing a discussion in nested v2 view.
- Source:
- Copyright:
- 2019 Ryan Wyllie
- 2019 Ryan Wyllie
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Members
(static, constant) init
Initialise the javascript for the discussion in nested v2 display mode.
(inner) showInPageReplyForm
Variable to hold the showInPageReplyForm function after it's built.
Methods
(inner) buildShowInPageReplyFormFunction(additionalTemplateContext) → {function}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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)
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)
Hide the post replies.
Parameters:
Name | Type | Description |
---|---|---|
postContainer |
Object | jQuery element for the post container |
(inner) incrementTotalReplyCount(postContainer)
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)
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}
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}
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)
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) |