Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Navigation: enable adding custom code to loadPage #4884
Add a new option $.mobile.loadPage.defaults.completeLoad which allows the user to define when a page has been fully loaded.
By default the existing functionality is unchanged - a page is considered loaded when the html has been added to the dom.
If pages include large images which are not preloaded or other asynchronous components, the page may be displayed before it is fully rendered.
Adding the below code (and the waitForImages plugin) to the app keeps the loading message visible for longer and does not start the transition until the page is actually ready to be displayed.
This was referenced
Sep 17, 2012
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
We're pretty much frozen on the navigation code at this point. There's going to be a gigantic cleanup coming soon so we'll likely wait until after that to consider something like this. Hopefully it'll also be easier to set up.
Thanks for the PR, the idea is entirely sound.