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

Commit

Permalink
Textinput: Make option clearBtn work at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
allsteady authored and Gabriel Schulhof committed Feb 7, 2014
1 parent 5190a95 commit e3761c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/widgets/forms/clearButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ define( [
_setOptions: function( options ) {
this._super( options );

if ( options.clearbtn !== undefined && !this.element.is( "textarea, :jqmData(type='range')" ) ) {
if ( options.clearBtn !== undefined && !this.element.is( "textarea, :jqmData(type='range')" ) ) {
if ( options.clearBtn ) {
this._addClearBtn();
} else {
Expand All @@ -100,7 +100,7 @@ define( [
}

if ( options.clearBtnText !== undefined && this._clearBtn !== undefined ) {
this._clearBtn.text( options.clearBtnText );
this._clearBtn.text( options.clearBtnText ).attr("title", options.clearBtnText);
}
},

Expand All @@ -114,7 +114,8 @@ define( [

_destroyClear: function() {
this.element.removeClass( "ui-input-has-clear" );
this._unbindClear()._clearBtn.remove();
this._unbindClear();
this._clearBtn.remove();
},

_destroy: function() {
Expand Down

0 comments on commit e3761c2

Please sign in to comment.