LoadMore

Created 'Load More' button

Source:
Properties:
Name Type Description
lastPostId Integer

Id of the last post loaded on the page

ad_class String

Ad item identifying class

ad_unit_class String

Ad inner div identifying class

loadmore_item_class string

css class for post item

loadmore_button_selector string

load more button selector

loadmore_ended_selector string

selector of end of load more list

data_region string

data attribute for region

data_post_id String

data attribute for post id

Methods

(inner) getMoreResults($button, action, params)

Source:

Updates button attributes for page result and ad position Calls ajax

Parameters:
Name Type Description
$button HTMLElement

html element of load more button

action String

ajax action

params Object

params to be sent via ajax call

(inner) handleButtonClick()

Source:

Updates button attributes for page result and ad position Calls ajax

(inner) init()

Source:

Initialize 'Load More' button and bind click event.

(inner) setButtonAttributes($button, data)

Source:

Set data attributes for load more button

Parameters:
Name Type Description
$button HTMLElement

button element

data Object

parameters to be sent via ajax call

(inner) toggleButtonAndShimmer()

Source:

Toggle hide/show class on 'Load More' button and placeholder list

(inner) track($target)

Source:

Track analytics when load more clicked

Parameters:
Name Type Description
$target HTMLElement

button element