Constructor
new SearchView()
- Since:
- Source:
Extends
Members
className
- Source:
templateVars
Values meant to be used by the rendered HTML template.
- Source:
type :string
The type of View this is
Type:
- Source:
Methods
Helper function to focus input on the search query input and ensure
that the cursor is at the end of the text (as opposed to the beginning
which appears to be the default jQuery behavior).
- Source:
getList() → {HTMLUListElement}
Getter function for the list of predictions.
- Source:
Returns:
Returns the predictions unordered list
HTML element.
-
Type
-
HTMLUListElement
Getter function for the search query input.
- Source:
Returns:
Returns the search input HTML element.
-
Type
-
HTMLInputElement
hidePredictionsList(event)
Hide the predictions list unless user is selecting a list item.
Parameters:
Name |
Type |
Description |
event |
FocusEvent
|
Mouse event corresponding to a change in
focus. |
- Source:
keydown()
Event handler to prevent cursor from jumping to beginning
of an input field (default behavior).
- Source:
keyup()
Event handler for Backbone.View configuration that is called whenever
the user types a key.
- Source:
render()
Render the view by updating the HTML of the element.
The new HTML is computed from an HTML template that
is passed an object with relevant view state.
- Source:
renderPredictionsList()
Render the Prediction sub-views.
- Source:
Render the SearchInputView.
- Source:
search()
Trigger the search on the ViewfinderModel.
- Source:
setQuery()
Helper function to set the input field.
- Source:
setupListeners()
Setup all event listeners on ViewfinderModel.
- Source:
showPredictionsList()
Show the predictions list and potentially submit a search for new
Predictions to display when there is a search query.
- Source: