Skip to content
Kris Erickson edited this page Jan 21, 2014 · 4 revisions

PAGE_START

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.

PAGE_END

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.

SCROLL_START

The event is fired when the user starts scrolling a "scrollable" container.

SCROLL_END

The event is fired when the user completes scrolling a "scrollable" container.

SHOW_MENU

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'});
   }
});

MENU_ITEM_CLICKED

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');
        }
    });