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

Commit

Permalink
Textinput: Added option corners. Fixes #5610.
Browse files Browse the repository at this point in the history
Also removed class ui-btn-shadow because we don't use that.
  • Loading branch information
jaspermdegroot committed May 23, 2013
1 parent be2c475 commit 698ffb2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 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,
corners: true,
mini: false,
// This option defaults to true on iOS devices.
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
Expand All @@ -26,6 +27,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
input = this.element,
o = this.options,
themeclass = " ui-body-" + ( o.theme ? o.theme : "inherit" ),
cornerclass = o.corners ? " ui-corner-all" : "",
miniclass = o.mini ? " ui-mini" : "",
isSearch = input.is( "[type='search'], :jqmData(type='search')" ),
isTextarea = input[ 0 ].tagName === "TEXTAREA",
Expand Down Expand Up @@ -66,7 +68,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
if ( isSearch || inputNeedsWrap ) {
classes = isSearch ? "ui-input-search" : "ui-input-text";

focusedEl = input.wrap( "<div class='" + classes + themeclass + miniclass + " ui-shadow-inset ui-corner-all ui-btn-shadow'></div>" ).parent();
focusedEl = input.wrap( "<div class='" + classes + themeclass + miniclass + cornerclass + " ui-shadow-inset'></div>" ).parent();
}


Expand Down Expand Up @@ -95,7 +97,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {

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

input.focus(function() {
Expand Down

0 comments on commit 698ffb2

Please sign in to comment.