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

Commit

Permalink
Textinput: Allow to set option mini programmatically. Fixes #4070.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspermdegroot committed Nov 8, 2012
1 parent 7f6c0ac commit 15129eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/jquery.mobile.forms.textinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ define( [ "jquery", "./jquery.mobile.core", "./jquery.mobile.widget", "./jquery.
$.widget( "mobile.textinput", $.mobile.widget, {
options: {
theme: null,
mini: false,
// This option defaults to true on iOS devices.
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])",
Expand All @@ -25,8 +26,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
o = this.options,
theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
themeclass = " ui-body-" + theme,
mini = input.jqmData("mini") == true,
miniclass = mini ? " ui-mini" : "",
miniclass = o.mini ? " ui-mini" : "",
focusedEl, clearbtn;

$( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
Expand Down Expand Up @@ -67,7 +67,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
iconpos: "notext",
corners: true,
shadow: true,
mini: mini
mini: o.mini
});

function toggleClear() {
Expand Down

0 comments on commit 15129eb

Please sign in to comment.