Skip to content

Commit

Permalink
Merge pull request jquery-archive#2874 from eddiemonge/patch-2
Browse files Browse the repository at this point in the history
Proposed fix for 2847
  • Loading branch information
gseguin committed Oct 28, 2011
2 parents d2d1074 + efd9a38 commit b4bb0ad
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions js/jquery.mobile.forms.textinput.js
Expand Up @@ -67,17 +67,14 @@ $.widget( "mobile.textinput", $.mobile.widget, {
});

function toggleClear() {
if ( !input.val() ) {
clearbtn.addClass( "ui-input-clear-hidden" );
} else {
clearbtn.removeClass( "ui-input-clear-hidden" );
}
setTimeout(function() {
clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
}, 0);
}

toggleClear();

input.keyup( toggleClear )
.focus( toggleClear );
input.bind('paste cut keyup focus change blur', toggleClear);

} else {
input.addClass( "ui-corner-all ui-shadow-inset" + themeclass );
Expand Down

0 comments on commit b4bb0ad

Please sign in to comment.