From 4094e7bb65aa4e4037f02587f993d97a018713eb Mon Sep 17 00:00:00 2001 From: John Chacko Date: Wed, 13 Mar 2013 13:50:49 +0000 Subject: [PATCH] Update textinput.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reference to issue https://github.com/jquery/jquery-mobile/issues/5708 added 'refresh' method to textinput --- js/widgets/forms/textinput.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/widgets/forms/textinput.js b/js/widgets/forms/textinput.js index 2ee20012b36..97c88fbd0ee 100644 --- a/js/widgets/forms/textinput.js +++ b/js/widgets/forms/textinput.js @@ -178,6 +178,15 @@ $.widget( "mobile.textinput", $.mobile.widget, { } $el.removeClass( "ui-disabled" ); return this._setOption( "disabled", false ); + }, + + refresh: function() { + var $el = this.element, + clearbtn = $el.parent().find(".ui-input-clear"); + + setTimeout(function () { + clearbtn.toggleClass("ui-input-clear-hidden", !$el.val()); + }, 0); } });