mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-28 18:04:46 +00:00
move to a centralized form element selector to leverage keepnative
This commit is contained in:
parent
b358985ca2
commit
0e5583eae9
2 changed files with 7 additions and 3 deletions
|
|
@ -217,8 +217,6 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
|
|||
|
||||
//auto self-init widgets
|
||||
$( document ).bind( "pagecreate create", function( e ){
|
||||
$( $.mobile.selectmenu.prototype.options.initSelector, e.target )
|
||||
.not( ":jqmData(role='none'), :jqmData(role='nojs')" )
|
||||
.selectmenu();
|
||||
$.mobile.selectmenu.prototype.enhanceWithin( e.target );
|
||||
});
|
||||
})( jQuery );
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@ $.widget( "mobile.widget", {
|
|||
});
|
||||
|
||||
return options;
|
||||
},
|
||||
|
||||
enhanceWithin: function( target ) {
|
||||
var keepNative = $.mobile.page.prototype.keepNativeSelector();
|
||||
|
||||
$( this.options.initSelector, target ).not( keepNative )[this.widgetName]();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue