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

Commit 58e94db

Browse files
author
Gabriel Schulhof
committed
Navigate event: Create a custom event called "beforenavigate" so that, when someone binds to "beforenavigate", the "navigate" event will be initialized.
1 parent 30fd6fe commit 58e94db

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

js/events/navigate.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,19 @@ define([
1212
//>>excludeEnd("jqmBuildExclude");
1313

1414
(function( $, undefined ) {
15-
var $win = $.mobile.window, self, history;
15+
var $win = $.mobile.window, self, history,
16+
dummyFnToInitNavigate = function() {
17+
};
18+
19+
$.event.special.beforenavigate = {
20+
setup: function() {
21+
$win.on( "navigate", dummyFnToInitNavigate );
22+
},
23+
24+
teardown: function() {
25+
$win.off( "navigate", dummyFnToInitNavigate );
26+
}
27+
}
1628

1729
$.event.special.navigate = self = {
1830
bound: false,

0 commit comments

Comments
 (0)