Class: ViewModel

app.ViewModel()

new ViewModel()

ViewModel
Source:

Methods

(static) centerPanMap()

On small screens, pan the map down 120px to make room for the infoWindow.
Source:

(static) filterRatings()

Toggles diamond rating checkbox, and filters hotels displayed by rating.
Source:

(static) getHotels() → {array}

Source:
Returns:
- An array of objects for each hotel
Type
array

(static) getHotelsLength() → {number}

Source:
Returns:
- The length of the hotels array
Type
number

(static) getKeys() → {object}

Source:
Returns:
- Yelp API keys
Type
object

(static) getRatings() → {array}

Source:
Returns:
- List of diamond rating value, icon, and color
Type
array

(static) gotoHotel()

Runs when a hotel is selected in the list view.
Source:

(static) hotelDisplay() → {object}

Real time filtering of hotels displayed in the list and map.
Source:
Returns:
- Filtered list of hotels
Type
object

(static) init()

Saves the list of hotels and initializes the map.
Source:

(static) nameSort() → {array}

Source:
Returns:
- Alphabetically sorted list of hotel names
Type
array

(static) noEnter() → {boolean}

Prevents the page from refreshing when the key is pressed.
Source:
Returns:
- False
Type
boolean

(static) slideIn()

Slides in the filter menu and re-centers map on current marker.
Source:

(static) slideOut()

Slides out the filter menu and re-centers map on current marker.
Source:

(static) toggleDef()

Toggles display the Diamond Rating Definitions.
Source:

(static) toggleList()

Toggles display of the Diamond Rating Definitions.
Source:

(static) toggleName()

Toggles display of the Hotel Name search
Source:

(static) toggleRating()

Toggles display of the Diamond Rating filter
Source: