Permalink
Browse files

allow users to define keepnative on page elements

  • Loading branch information...
johnbender committed Oct 13, 2011
1 parent e9040c7 commit 2de28ee69f6ec110d27b9d351b77b230d150ad39
Showing with 3 additions and 2 deletions.
  1. +3 −2 js/jquery.mobile.widget.js
@@ -42,9 +42,10 @@ $.widget( "mobile.widget", {
// TODO remove dependency on the page widget for the keepNative.
// Currently the keepNative value is defined on the page prototype so
// the method is as well
- var keepNative = $.mobile.page.prototype.keepNativeSelector();
+ var page = $(target).data( "page" ),
+ keepNative = page && page.keepNativeSelector();
- $( this.options.initSelector, target ).not( keepNative )[ this.widgetName ]();
+ $( this.options.initSelector, target ).not( keepNative || "" )[ this.widgetName ]();
}
});

0 comments on commit 2de28ee

Please sign in to comment.