Merge remote branch 'origin/master'

This commit is contained in:
scottjehl 2011-01-26 22:15:10 -08:00
commit e2c66fad49

View file

@ -153,32 +153,49 @@ $.widget( "mobile.page", $.mobile.widget, {
}
});
// We re-find form elements since the degredation code above
// may have injected new elements. We cache the non-native control
// query to reduce the number of times we search through the entire page.
var allControls = this.element.find("input, textarea, select, button"),
nonNativeControls = allControls.not(this.keepNative);
// XXX: Temporary workaround for issue 785. Turn off autocorrect and
// autocomplete since the popup they use can't be dismissed by
// the user. Note that we test for the presence of the feature
// by looking for the autocorrect property on the input element.
var textInputs = allControls.filter( "input[type=text]" );
if (textInputs.length && typeof textInputs[0].autocorrect !== "undefined") {
textInputs.each(function(){
// Set the attribute instead of the property just in case there
// is code that attempts to make modifications via HTML.
this.setAttribute("autocorrect", "off");
this.setAttribute("autocomplete", "off");
});
}
// enchance form controls
this.element
.find( "[type='radio'], [type='checkbox']" )
.not(this.keepNative)
nonNativeControls
.filter( "[type='radio'], [type='checkbox']" )
.checkboxradio();
this.element
.find( "button, [type='button'], [type='submit'], [type='reset'], [type='image']" )
.not(this.keepNative)
nonNativeControls
.filter( "button, [type='button'], [type='submit'], [type='reset'], [type='image']" )
.button();
this.element
.find( "input, textarea" )
.not( "[type='radio'], [type='checkbox'], button, [type='button'], [type='submit'], [type='reset'], [type='image'], [type='hidden']" )
.not(this.keepNative)
nonNativeControls
.filter( "input, textarea" )
.not( "[type='radio'], [type='checkbox'], [type='button'], [type='submit'], [type='reset'], [type='image'], [type='hidden']" )
.textinput();
this.element
.find( "input, select" )
.not(this.keepNative)
nonNativeControls
.filter( "input, select" )
.filter( "[data-role='slider'], [data-type='range']" )
.slider();
this.element
.find( "select:not([data-role='slider'])" )
.not(this.keepNative)
nonNativeControls
.filter( "select:not([data-role='slider'])" )
.selectmenu();
}
});