directive:mohistory.collectionLists source

Directive for the main navigation bar. Data to populate menu is passed in from parent.

Dependencies:
NameTypeDescription
$transitions

UI-Router service for creating hooks that are triggered on route changes

$rootScope

Master scope for any AngularJS application

Methods

addFacet (facetType, currentFacet)

Wrapper for a call to searchFacets.addFacetToHash, which handles storing the facet in the state.

Parameters:
NameTypeDescription
facetType

Major category of facet, e.g. 'department' or 'collection'

currentFacet

Specific facet to filter by, e.g. 'Archival Collections'

filterList

Filter the full list of collections based on keyword and/or filter parameter.

isAFacetSelected (facetType)

Wrapper for a call to searchFacets.isAFacetSelected, which returns true if any facet of the given type is stored in the state, false otherwise.

Parameters:
NameTypeDescription
facetType

Major category of facet, e.g. 'department' or 'collection'

Returns:

true if there is at least one facet of the given type in the url hash, false otherwise.

isFacetSelected (facetType, currentFacet)

Wrapper for searchFacets.isFacetSelected, which returns true if the specified facet is stored in state.

Parameters:
NameTypeDescription
facetType

Major category of facet, e.g. 'dept' or 'collection'

currentFacet

Specific facet to filter by, e.g. 'Archival Collections'

Returns:

True if the given facet is in the url hash, false otherwise

nextPage

Navigate to the next search result page by triggering a router transition.

onDestroy

Clean up function called when a component is removed.

onFormSubmit

Update the UI-Router state to reflect a new keyword search.

onInit

Initialization code run every time the component is created, used to setup variables and to retrieve data from local files.

prevPage

Navigate to the previous search result page by triggering a router transition.

removeFacet (facetType, currentFacet)

Wrapper for a call to searchFacets.removeFacetFromHash, which handles removing a facet from the state.

Parameters:
NameTypeDescription
facetType

Major category of facet, e.g. 'department' or 'collection'

currentFacet

Specific facet to filter by, e.g. 'Archival Collections'

setPage (num)

Navigate to the provided search result page by triggering a router transition.

Parameters:
NameTypeDescription
num

The page number to navigate to

toggleFacet (facetType, currentFacet)

Wrapper for a call to searchFacets.toggleFacetInHash. If the facet's first character is '-' remove it, else add a minus to the front of the string. Then, remove the old facet and add the new one.

Parameters:
NameTypeDescription
facetType

Major category of facet, e.g. 'department' or 'collection'

currentFacet

Specific facet to filter by, e.g. 'Archival Collections'