Skip to content
Browse files

Textinput: Added "disabled" to the configurable options.

  • Loading branch information...
1 parent 0daf483 commit 1f2d190c25b8041577ad0beaadf3bc0c97ca8838 @jaspermdegroot jaspermdegroot committed Jul 3, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 js/widgets/forms/textinput.js
View
5 js/widgets/forms/textinput.js
@@ -15,7 +15,8 @@ $.widget( "mobile.textinput", $.mobile.widget, {
// This option defaults to true on iOS devices.
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])",
- clearSearchButtonText: "clear text"
+ clearSearchButtonText: "clear text",
+ disabled: false
},
_create: function() {
@@ -139,11 +140,13 @@ $.widget( "mobile.textinput", $.mobile.widget, {
disable: function(){
( this.element.attr( "disabled", true ).is( "[type='search'],:jqmData(type='search')" ) ?
this.element.parent() : this.element ).addClass( "ui-disabled" ).attr( "aria-disabled", true );
+ return this._setOption( "disabled", true );
},
enable: function(){
( this.element.attr( "disabled", false).is( "[type='search'],:jqmData(type='search')" ) ?
this.element.parent() : this.element ).removeClass( "ui-disabled" ).attr( "aria-disabled", false );
+ return this._setOption( "disabled", false );
}
});

1 comment on commit 1f2d190

@jaspermdegroot
jQuery Foundation member

cherry-pick 1.1.2.

Please sign in to comment.
Something went wrong with that request. Please try again.