@@ -25,12 +25,14 @@ $.widget( "mobile.page", $.mobile.widget, {
25
25
url : false ,
26
26
week : false
27
27
} ,
28
- keepNative : "[data-role='none'], .ui-nojs"
28
+ keepNative : null
29
29
} ,
30
30
31
31
_create : function ( ) {
32
32
var $elem = this . element ,
33
- o = this . options ;
33
+ o = this . options ;
34
+
35
+ this . keepNative = "[data-role='none'], [data-role='nojs']" + ( o . keepNative ? ", " + o . keepNative : "" ) ;
34
36
35
37
if ( this . _trigger ( "beforeCreate" ) === false ) {
36
38
return ;
@@ -124,7 +126,7 @@ $.widget( "mobile.page", $.mobile.widget, {
124
126
//links in bars, or those with data-role become buttons
125
127
$elem . find ( "[data-role='button'], .ui-bar a, .ui-header a, .ui-footer a" )
126
128
. not ( ".ui-btn" )
127
- . not ( o . keepNative )
129
+ . not ( this . keepNative )
128
130
. buttonMarkup ( ) ;
129
131
130
132
$elem
@@ -133,7 +135,7 @@ $.widget( "mobile.page", $.mobile.widget, {
133
135
134
136
//links within content areas
135
137
$elem . find ( "a:not(.ui-btn):not(.ui-link-inherit)" )
136
- . not ( o . keepNative )
138
+ . not ( this . keepNative )
137
139
. addClass ( "ui-link" ) ;
138
140
139
141
//fix toolbars
@@ -144,7 +146,7 @@ $.widget( "mobile.page", $.mobile.widget, {
144
146
var o = this . options ;
145
147
146
148
// degrade inputs to avoid poorly implemented native functionality
147
- this . element . find ( "input" ) . not ( o . keepNative ) . each ( function ( ) {
149
+ this . element . find ( "input" ) . not ( this . keepNative ) . each ( function ( ) {
148
150
var type = this . getAttribute ( "type" ) ,
149
151
optType = o . degradeInputs [ type ] || "text" ;
150
152
@@ -158,29 +160,29 @@ $.widget( "mobile.page", $.mobile.widget, {
158
160
// enchance form controls
159
161
this . element
160
162
. find ( "[type='radio'], [type='checkbox']" )
161
- . not ( o . keepNative )
163
+ . not ( this . keepNative )
162
164
. checkboxradio ( ) ;
163
165
164
166
this . element
165
167
. find ( "button, [type='button'], [type='submit'], [type='reset'], [type='image']" )
166
- . not ( o . keepNative )
168
+ . not ( this . keepNative )
167
169
. button ( ) ;
168
170
169
171
this . element
170
172
. find ( "input, textarea" )
171
173
. not ( "[type='radio'], [type='checkbox'], button, [type='button'], [type='submit'], [type='reset'], [type='image']" )
172
- . not ( o . keepNative )
174
+ . not ( this . keepNative )
173
175
. textinput ( ) ;
174
176
175
177
this . element
176
178
. find ( "input, select" )
177
- . not ( o . keepNative )
179
+ . not ( this . keepNative )
178
180
. filter ( "[data-role='slider'], [data-type='range']" )
179
181
. slider ( ) ;
180
182
181
183
this . element
182
184
. find ( "select:not([data-role='slider'])" )
183
- . not ( o . keepNative )
185
+ . not ( this . keepNative )
184
186
. selectmenu ( ) ;
185
187
}
186
188
} ) ;
0 commit comments