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

Commit

Permalink
Prevent the slider number input from being wrapped in a div.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspermdegroot committed Dec 1, 2012
1 parent 70103a5 commit c924ed4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/widgets/forms/textinput.js
Expand Up @@ -35,7 +35,8 @@ $.widget( "mobile.textinput", $.mobile.widget, {
clearbtn,
clearBtnText = o.clearSearchButtonText || o.clearBtnText,
clearBtnBlacklist = input.is( "textarea, :jqmData(type='range')" ),
inputNeedsClearBtn = !!o.clearBtn && !clearBtnBlacklist;
inputNeedsClearBtn = !!o.clearBtn && !clearBtnBlacklist,
inputNeedsWrap = input.is( "input" ) && !input.is( ":jqmData(type='range')" );

function toggleClear() {
setTimeout( function() {
Expand Down Expand Up @@ -64,7 +65,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
//"search" and "text" input widgets
if ( isSearch ) {
focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-searchfield" + themeclass + miniclass + "'></div>" ).parent();
} else if ( input.is( "input" ) ) {
} else if ( inputNeedsWrap ) {
focusedEl = input.wrap( "<div class='ui-input-text ui-shadow-inset ui-corner-all ui-btn-shadow" + themeclass + miniclass + "'></div>" ).parent();
}

Expand All @@ -91,7 +92,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {

input.bind( "paste cut keyup focus change blur", toggleClear );
}
else if ( input.is( "textarea" ) ) {
else if ( !inputNeedsWrap && !isSearch ) {
input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass );
}

Expand Down

0 comments on commit c924ed4

Please sign in to comment.