Skip to content
Browse files

Textinput: minor code improvement. [1.1.2.]

  • Loading branch information...
1 parent c3a922a commit 13817e1b689d4ffc5a2341399728dcaa3e0acf81 @jaspermdegroot jaspermdegroot committed
Showing with 12 additions and 8 deletions.
  1. +12 −8 js/widgets/forms/textinput.js
View
20 js/widgets/forms/textinput.js
@@ -138,23 +138,27 @@ $.widget( "mobile.textinput", $.mobile.widget, {
},
disable: function(){
-
+
+ var $el;
if ( this.element.attr( "disabled", true ).is( "[type='search'],:jqmData(type='search')" ) ) {
- this.element.parent().addClass( "ui-disabled" );
+ $el = this.element.parent();
} else {
- this.element.addClass( "ui-disabled" );
- }
+ $el = this.element;
+ }
+ $el.addClass( "ui-disabled" );
return this._setOption( "disabled", true );
},
enable: function(){
-
+
+ var $el;
if ( this.element.attr( "disabled", false ).is( "[type='search'],:jqmData(type='search')" ) ) {
- this.element.parent().removeClass( "ui-disabled" );
+ $el = this.element.parent();
} else {
- this.element.removeClass( "ui-disabled" );
- }
+ $el = this.element;
+ }
+ $el.removeClass( "ui-disabled" );
return this._setOption( "disabled", false );
}

0 comments on commit 13817e1

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