File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,15 @@ $.mobile.page.prototype.options.degradeInputs = {
2323 week : false
2424} ;
2525
26- $ . mobile . page . prototype . options . keepNative = ":jqmData(role='none'), :jqmData(role='nojs')" ;
27-
2826
2927//auto self-init widgets
3028$ ( document ) . bind ( "pagecreate create" , function ( e ) {
3129
32- var o = $ . mobile . page . prototype . options ;
30+ var page = $ ( e . target ) . closest ( ':jqmData(role="page")' ) . data ( "page" ) ,
31+ o = page . options ;
3332
3433 // degrade inputs to avoid poorly implemented native functionality
35- $ ( e . target ) . find ( "input" ) . not ( o . keepNative ) . each ( function ( ) {
34+ $ ( e . target ) . find ( "input" ) . not ( page . keepNativeSelector ( ) ) . each ( function ( ) {
3635 var $this = $ ( this ) ,
3736 type = this . getAttribute ( "type" ) ,
3837 optType = o . degradeInputs [ type ] || "text" ;
Original file line number Diff line number Diff line change 33 */
44
55( function ( $ ) {
6+
7+
68 module ( 'jquery.mobile.slider.js' , {
79 setup : function ( ) {
810 $ ( '#test-container' ) . html ( "" ) ;
911 }
1012 } ) ;
1113
14+ test ( 'keepNative elements should not be degraded' , function ( ) {
15+ same ( $ ( 'input#not-to-be-degraded' ) . attr ( "type" ) , "range" ) ;
16+ } ) ;
17+
1218 test ( 'input type color should not degrade when "create" event is triggered' , function ( ) {
1319 $ ( '#test-container' ) . html ( '<input type="color" />' ) . trigger ( "create" ) ;
1420
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ <h2 id="qunit-userAgent"></h2>
2727
2828< div id ="foo " data-nstest-role ="page ">
2929
30+ < input id ="not-to-be-degraded " type ="range " data-nstest-role ="nojs " />
31+
3032 < div id ="test-container ">
3133 </ div >
3234
You can’t perform that action at this time.
0 commit comments