Skip to content


pull request for issue #4984 #5059

wants to merge 1 commit into from

2 participants


this is a pull request for a small code change to bring back _registerInternalEvents to allow overriding of JQM's event handlers in plugins as per this issue: #4984

I had to defer the registering of the callback to navreadyDeferred by binding it to mobileinit, because once registered to a deferred, it doesn't matter if _registerInternalEvents value is changed - deferred still points to the original callback.

so am not sure this is a good solution, but provided here for your review anyways.


Merged as discussed in the issue.

@gabrielschulhof gabrielschulhof referenced this pull request from a commit
@gabrielschulhof gabrielschulhof [navigation] Re-instate $.mobile_registerInternalEvents - thanks asyr…
…af9 -- Fixes #4984, #5059


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 21, 2012
  1. @asyraf9
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 2 deletions.
  1. +5 −2 js/
7 js/
@@ -1243,7 +1243,7 @@ define( [
//The following event bindings should be bound after mobileinit has been triggered
//the following deferred is resolved in the init file
$.mobile.navreadyDeferred = $.Deferred();
- $.mobile.navreadyDeferred.done(function() {
+ $.mobile._registerInternalEvents = function() {
//bind to form submit events, handle with Ajax
$( document ).delegate( "form", "submit", function( event ) {
var $this = $( this );
@@ -1545,7 +1545,10 @@ define( [
$( document ).bind( "pageshow", resetActivePageHeight );
$( window ).bind( "throttledresize", resetActivePageHeight );
- });//navreadyDeferred done callback
+ };//navreadyDeferred done callback
+ $( window.document ).bind('mobileinit', function() {
+ $.mobile.navreadyDeferred.done($.mobile._registerInternalEvents())
+ });
})( jQuery );
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
Something went wrong with that request. Please try again.