Permalink
Browse files

Fixed a potential issue with handlers scoping

  • Loading branch information...
1 parent 9594468 commit fb68ccf1ce31a388ce49a40435314bf7cfbe21f9 @azicchetti committed Feb 13, 2012
Showing with 10 additions and 6 deletions.
  1. +2 −1 README.md
  2. +6 −3 js/jquery.mobile.router.js
  3. +2 −2 js/jquery.mobile.router.min.js
View
@@ -268,6 +268,7 @@ myHandlers object
-----------------
There isn't much to say about this object. Simply provide the function handlers you've
specified in the myRoutes object.
+By default, your route handlers are executed in the myHandlers scope.
For example:
@@ -393,4 +394,4 @@ You don’t have to do anything special to choose one license or the other and y
**For more information see:**
* [MIT License](http://github.com/azicchetti/jquerymobile-router/blob/master/MIT-LICENSE.txt) [(More Information)](http://en.wikipedia.org/wiki/MIT_License)
-* [GPL](http://github.com/azicchetti/jquerymobile-router/blob/master/GPL-LICENSE.txt) [(More Information)](http://en.wikipedia.org/wiki/GNU_General_Public_License)
+* [GPL](http://github.com/azicchetti/jquerymobile-router/blob/master/GPL-LICENSE.txt) [(More Information)](http://en.wikipedia.org/wiki/GNU_General_Public_License)
@@ -1,5 +1,5 @@
/*!
- * jQueryMobile-router v0.6
+ * jQueryMobile-router v0.7
* http://github.com/azicchetti/jquerymobile-router
*
* Copyright 2011 (c) Andrea Zicchetti
@@ -166,8 +166,11 @@ $(document).bind("mobileinit",function(){
evtList.push(evt);
}
});
- if (!this.userHandlers) this.userHandlers={};
- $.extend(this.userHandlers,userHandlers||{});
+ if (!this.userHandlers){
+ this.userHandlers=userHandlers||{};
+ } else {
+ $.extend(this.userHandlers,userHandlers||{});
+ }
this._detachEvents();
if (evtList.length>0){
this._liveData={

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

Oops, something went wrong.

0 comments on commit fb68ccf

Please sign in to comment.