Permalink
Browse files

Execute handler functions in the ControllerObject scope, allows you t…

…o use this in handler functions
  • Loading branch information...
1 parent 4329e10 commit f2f3549d93b988571aff8e0015a776352b0a8dd9 @ivorbosloper ivorbosloper committed Feb 11, 2012
Showing with 5 additions and 5 deletions.
  1. +3 −3 js/jquery.mobile.router.js
  2. +2 −2 js/jquery.mobile.router.min.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQueryMobile-router v0.6
* http://github.com/azicchetti/jquerymobile-router
*
@@ -227,7 +227,7 @@ $(document).bind("mobileinit",function(){
handleFn=_self.userHandlers[handler];
}
if (handleFn){
- try { handleFn(e.type,res,ui,page,e); bHandled = true;
+ try { handleFn.apply(_self.userHandlers, [e.type,res,ui,page,e]); bHandled = true;
}catch(err){ debug(err); }
}
}
@@ -236,7 +236,7 @@ $(document).bind("mobileinit",function(){
if (!bHandled && this.conf.defaultHandler && this.defaultHandlerEvents[e.type]) {
if (typeof(this.conf.defaultHandler) == "function") {
try {
- this.conf.defaultHandler(e.type, ui, page, e);
+ this.conf.defaultHandler.apply(_self.userHandlers, [e.type, ui, page, e]);
} catch(err) { debug(err); }
}
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit f2f3549

Please sign in to comment.