SearchPageSelectorView

searchPageSelector. SearchPageSelectorView

new SearchPageSelectorView()

Source:

Extends

  • Backbone.View

Members

events

Source:
list of events for Backbone View

Methods

(static) init()

Source:
For each page selector on a page creates instance of "SearchPageSelectorModel" and "SearchPageSelectorView"

createFirstPageUrlHash(data) → {String}

Source:
Calculates hash parameters for first page
Parameters:
Name Type Description
data Object Data that contains component properties
Returns:
hash parameter for first page
Type
String

handleButtonState(selectedPage, pageCount)

Source:
Sets up page selectors buttons state depending on selected values
Parameters:
Name Type Description
selectedPage Number number of selected page
pageCount Number number of pages

handleLoadedData(data)

Source:
Updates hash and model based on data object
Parameters:
Name Type Description
data Object Data that contains component properties

initialize()

Source:
Initially sets data to model and watches events on which view should be updated
Listens to Events:
  • module:searchPageSelector.SearchPageSelectorView~event:change
  • module:XA.component.search.vent~event:results-loaded

render()

Source:
Renders view

showFirstPage(event)

Source:
Switches page selector to the first page and updates hash parameters
Parameters:
Name Type Description
event Event Event object that contains target with selected component value

showLastPage(event)

Source:
Switches page selector to the last page and updates hash parameters
Parameters:
Name Type Description
event Event Event object that contains target with selected component value

showNextPage(event)

Source:
Switches page selector to the next page and updates hash parameters
Parameters:
Name Type Description
event Event Event object that contains target with selected component value

showPrevPage(event)

Source:
Switches page selector to the precious page and updates hash parameters
Parameters:
Name Type Description
event Event Event object that contains target with selected component value

updateElementCssClass(data)

Source:
Function that based on selected component values sets css class page-selector-empty or page-selector-single-page
Parameters:
Name Type Description
data Object Data that contains component properties

updateModelAfterSearch(data, selectedValue)

Source:
Updates model values with selectedValue and data object from server response
Parameters:
Name Type Description
data Object Data that contains component properties
selectedValue Number number of selected page

updateSelectedValue(event)

Source:
Updates hash according to changed component value
Parameters:
Name Type Description
event Event Event object that contains target with selected component value