-
Notifications
You must be signed in to change notification settings - Fork 10
Topcoat Events
Event is fired when the user arrives at the page. The page will be fully loaded (I.e. you will know the dimensions of the page) when the event is fired.
The event is fired just before leaving the page. There is no way to cancel a page leave through this event, though that might be coming.
The event is fired when the user starts scrolling a "scrollable" container.
The event is fired when the user completes scrolling a "scrollable" container.
The event is fired when the .menu-button class is clicked (this gets added automatically if menu option is set to true or a collection of menu items on TopcoatTouch initialization). The current page and the current state of the menu collection is sent to the callback. The callback should return the state of the menu desired. Note: Show menu can be fired in multiple controllers and you are responsible for the order of the items in the menuItems array.
Example:
tt.on(tt.EVENTS.SHOW_MENU, function(currentPage, menuItems) {
if (currentPage != 'about')) {
menuItems.push({name: 'About', 'id': 'about'});
}
});
Event that is fired when a menu item is clicked.
Example:
tt.on(tt.EVENTS.MENU_ITEM_CLICKED, function(currentPage, menuId) {
if (menuId == 'about') {
tt.goTo('about');
}
});