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

Commit 827bec3

Browse files
Textinput: Allow to set option mini programmatically. Fixes #4070.
1 parent f242daa commit 827bec3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/widgets/forms/textinput.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ define( [ "jquery", "../../jquery.mobile.core", "../../jquery.mobile.widget", ".
1212
$.widget( "mobile.textinput", $.mobile.widget, {
1313
options: {
1414
theme: null,
15+
mini: false,
1516
// This option defaults to true on iOS devices.
1617
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
1718
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']",
@@ -26,8 +27,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
2627
o = this.options,
2728
theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
2829
themeclass = " ui-body-" + theme,
29-
mini = input.jqmData( "mini" ) === true,
30-
miniclass = mini ? " ui-mini" : "",
30+
miniclass = o.mini ? " ui-mini" : "",
3131
focusedEl, clearbtn;
3232

3333
function toggleClear() {
@@ -74,7 +74,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
7474
iconpos: "notext",
7575
corners: true,
7676
shadow: true,
77-
mini: mini
77+
mini: o.mini
7878
});
7979

8080
toggleClear();

0 commit comments

Comments
 (0)