Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Refactor: navigation.js A4.1 extensibility

StevenBlack edited this page May 4, 2011 · 24 revisions

List of triggers fired by jquery.mobile.navigation.js @ A4.1

In function transitionPages() definition:

  • from.data( "page" )._trigger( "beforehide", null, { nextPage: to } ); on L447
  • to.data( "page" )._trigger( "beforeshow", null, { prevPage: from || $( "" ) } ); on L449.
    Notes
  • These two triggers are co-located and occur essentially at the same juncture.
  • It's widely agreed that the beforeshow trigger, implementation-named pagebeforeshow via the widget factory, needs to be moved until the page is, in fact, right before show.

In function pageChangeComplete() definition:

  • from.data( "page" )._trigger( "hide", null, { nextPage: to } ); on L482
  • to.data( "page" )._trigger( "show", null, { prevPage: from || $( "" ) } ); on L485.

Notes

  • These two triggers are co-located and occur essentially at the same juncture.

List of clear junctures in jquery.mobile.navigation.js @ A4.1

  • At the top of changePage() to allow for situation specific overrides or pre-empting. For example,
    • overriding the current constraint on navigating to the same url, or
    • forcing a user gesture-consistent transition.