jquery/jquery-mobile — pull request #6655 by allsteady (2013-10-25 06:37:57+00:00)
Title:  A user should not change  the value of clearBtn option in runtime.

API Doc inform to user that the value of clearBtn option should be able to change in runtime. But it does not work properly due to two mistake.

So, This PR is containing solutions about this bugs.

If you want to see demos, please visit blow URLs.
Origin : http://hyunsook.github.io/jqm-debug/latest/textinput-clearbtn-origin.html
Patch applied : http://hyunsook.github.io/jqm-debug/latest/textinput-clearbtn-after.html

First is that undefined variable name(clearbtn) is used in the function.
This variable name must change to 'clearBtn'

_setOptions: function( options ) {
this._super( options );

if ( options.clearbtn !== undefined && !this.element.is( "textarea, :jqmData(type='range')" ) ) {
if ( options.clearBtn ) {
this._addClearBtn();
} else {
this._destroyClear();
}
}

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

The other thing is below.
The method, 'unbindClear', return undefined value. So we can not use chaining at this point.

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

If there are any problems or mistakes on that PR, please let me know.
Thanks in advance.