Created
May 24, 2011 11:20
-
-
Save arsduo/988553 to your computer and use it in GitHub Desktop.
jQuery Mobile - page enhancement on demand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* jQuery Mobile Framework : "page" plugin | |
* Copyright (c) jQuery Project | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* http://jquery.org/license | |
*/ | |
(function($, undefined ) { | |
$.widget( "mobile.page", $.mobile.widget, { | |
// other code | |
_create: function() { | |
this.enhance(); | |
}, | |
enhance: function() { | |
var $elem = this.element, | |
o = this.options; | |
// rest of the original create function | |
} | |
}) | |
// you can then re-enhance the current page after changes by calling | |
$.mobile.urlHistory.getActive().page.page("enhance") | |
// ^^ this is a little bulky and would probably want a cleaner interface | |
// perhaps just a dedicated method to re-enhance the current page |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment