Permalink
Browse files

Textinput: Only set more padding right if option clear button is true…

…. Fixes #5470.
  • Loading branch information...
1 parent 41cffcb commit 177be1177fd333cb3b668820301d07ea264ece39 @jaspermdegroot jaspermdegroot committed Jan 20, 2013
Showing with 7 additions and 2 deletions.
  1. +2 −1 css/structure/jquery.mobile.forms.textinput.css
  2. +5 −1 js/widgets/forms/textinput.js
@@ -5,7 +5,8 @@ div.ui-input-text input.ui-input-text, div.ui-input-text textarea.ui-input-text,
.ui-input-search input.ui-input-text { border: none; width: 100%; padding: .4em 0; margin: 0; display: block; background: transparent none; outline: 0 !important; }
.ui-input-search, div.ui-input-text { margin: .5em 0; background-image: none; position: relative; }
.ui-input-search { padding: 0 30px; }
-div.ui-input-text { padding: 0 30px 0 .4em; }
+div.ui-input-text { padding: 0 .4em; }
+div.ui-input-has-clear { padding: 0 30px 0 .4em; }
input.ui-input-text.ui-mini, textarea.ui-input-text.ui-mini,
.ui-input-search.ui-mini, div.ui-input-text.ui-mini { margin: .25em 0; }
.ui-field-contain input.ui-input-text, .ui-field-contain textarea.ui-input-text,
@@ -46,7 +46,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
$( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
- focusedEl = input.addClass("ui-input-text ui-body-"+ theme );
+ focusedEl = input.addClass( "ui-input-text ui-body-"+ theme );
// XXX: Temporary workaround for issue 785 (Apple bug 8910589).
// Turn off autocorrect and autocomplete on non-iOS 5 devices
@@ -87,6 +87,10 @@ $.widget( "mobile.textinput", $.mobile.widget, {
shadow: true,
mini: o.mini
});
+
+ if ( !isSearch ) {
+ focusedEl.addClass( "ui-input-has-clear" );
+ }
toggleClear();

0 comments on commit 177be11

Please sign in to comment.