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 f242daa commit 827bec3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/widgets/forms/textinput.js
Expand Up @@ -12,6 +12,7 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
$.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]), input[type='file']",
Expand All @@ -26,8 +27,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;

function toggleClear() {
Expand Down Expand Up @@ -74,7 +74,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
iconpos: "notext",
corners: true,
shadow: true,
mini: mini
mini: o.mini
});

toggleClear();
Expand Down

0 comments on commit 827bec3

Please sign in to comment.