Permalink
Browse files

Fixed the disabled styling of textinput elements.

  • Loading branch information...
1 parent 716f2b8 commit 053f99204fcd3273ac4fccf177e2ad86f2ed61fa @jaspermdegroot jaspermdegroot committed Dec 5, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 js/widgets/forms/textinput.js
@@ -148,7 +148,10 @@ $.widget( "mobile.textinput", $.mobile.widget, {
disable: function() {
var $el,
- parentNeedsDisabled = this.element.attr( "disabled", true ) && ( this.element.is( "[type='search'], :jqmData(type='search')" ) || ( this.element.is( "[type='text'],textarea" ) && !!this.options.clearBtn ) );
+ isSearch = this.element.is( "[type='search'], :jqmData(type='search')" ),
+ inputNeedsWrap = this.element.is( "input" ) && !this.element.is( ":jqmData(type='range')" ),
+ parentNeedsDisabled = this.element.attr( "disabled", true ) && ( inputNeedsWrap || isSearch );
+
if ( parentNeedsDisabled ) {
$el = this.element.parent();
} else {
@@ -160,9 +163,10 @@ $.widget( "mobile.textinput", $.mobile.widget, {
enable: function() {
var $el,
- parentNeedsDisabled = this.element.attr( "disabled", true ) && ( this.element.is( "[type='search'], :jqmData(type='search')" ) || ( this.element.is( "[type='text'],textarea" ) && !!this.options.clearBtn ) );
+ isSearch = this.element.is( "[type='search'], :jqmData(type='search')" ),
+ inputNeedsWrap = this.element.is( "input" ) && !this.element.is( ":jqmData(type='range')" ),
+ parentNeedsDisabled = this.element.attr( "disabled", true ) && ( inputNeedsWrap || isSearch );
- // TODO using more than one line of code is acceptable ;)
if ( parentNeedsDisabled ) {
$el = this.element.parent();
} else {

0 comments on commit 053f992

Please sign in to comment.