Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

pull request for issue #4984 #5059

Closed
wants to merge 1 commit into from

2 participants

Asyraf Abdul Rahman Gabriel "_|Nix|_" Schulhof
Asyraf Abdul Rahman

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.

Gabriel "_|Nix|_" Schulhof
Collaborator

Merged as discussed in the issue.

Gabriel "_|Nix|_" Schulhof gabrielschulhof referenced this pull request from a commit
Gabriel "_|Nix|_" Schulhof gabrielschulhof [navigation] Re-instate $.mobile_registerInternalEvents - thanks asyr…
…af9 -- Fixes #4984, #5059

Conflicts:

	js/jquery.mobile.navigation.js
9de514c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 2 deletions.
  1. +5 −2 js/jquery.mobile.navigation.js
7 js/jquery.mobile.navigation.js
View
@@ -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.