Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Textinput: Added "disabled" to the configurable options.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspermdegroot committed Jul 3, 2012
1 parent 0daf483 commit 1f2d190
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion js/widgets/forms/textinput.js
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 );
}
});

Expand Down

1 comment on commit 1f2d190

@jaspermdegroot
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cherry-pick 1.1.2.

Please sign in to comment.