Module: components/filter

Methods

(inner) filterActive(item, thisActive)

Add class 'is-active' to the item of the navigation clicked.

Parameters:
Name Type Description
item HTMLCollection

filter list

thisActive Element

filter selected

Source:
See:

(inner) filterAdd(elementDom, responseData)

Add navigation menu filtering through the 3 types of data (characters, locations and episodes) to the app content.

Parameters:
Name Type Description
elementDom HTMLElement

DOM element where the filter is inserted

responseData object

response data of the ajax handler (json)

Source:
See:

(inner) filterAddAllContent()

Insert the content

Source:
See:

(inner) filterAddContent(elementDom, responseData)

Add the filter content application

Parameters:
Name Type Description
elementDom HTMLElement

DOM element where the filter content is inserted

responseData object

response data of the ajax handler (json)

Source:
See:

(inner) filterAddContentInfo(responseData) → {Element}

Insert information to the content with the number of results of the request

Parameters:
Name Type Description
responseData object

response data of the ajax handler (json)

Source:
See:
Returns:

returns the info content element

Type
Element

(inner) filterAddContentResults(responseData) → {Element}

Insert results to the content of the request

Parameters:
Name Type Description
responseData object

response data of the ajax handler (json)

Source:
See:
Returns:

returns the results content element

Type
Element

(inner) filterFoundContent() → {boolean}

Check if the contents of one filter are shown and before loading another one, delete it

Source:
See:
Returns:

returns true if content was replaced, false otherwise

Type
boolean

(inner) filterRemoveContent()

Remove the selected filter content of the application content

Source:
See:

(inner) filterSetAction(action, elementDom, dataResponse)

List of functions to choose from

Parameters:
Name Type Description
action string

name of the action to execute

elementDom HTMLElement

DOM element where the response data is inserted

dataResponse object

response data of the ajax handler (json)

Source:
See: