Skip to content

Commit 2de28ee

Browse files
committed
allow users to define keepnative on page elements
1 parent e9040c7 commit 2de28ee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/jquery.mobile.widget.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ $.widget( "mobile.widget", {
4242
// TODO remove dependency on the page widget for the keepNative.
4343
// Currently the keepNative value is defined on the page prototype so
4444
// the method is as well
45-
var keepNative = $.mobile.page.prototype.keepNativeSelector();
45+
var page = $(target).data( "page" ),
46+
keepNative = page && page.keepNativeSelector();
4647

47-
$( this.options.initSelector, target ).not( keepNative )[ this.widgetName ]();
48+
$( this.options.initSelector, target ).not( keepNative || "" )[ this.widgetName ]();
4849
}
4950
});
5051

0 commit comments

Comments
 (0)