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

Commit

Permalink
Deprecated option shadowicon. Add class ui-shadow-icon to a container…
Browse files Browse the repository at this point in the history
… or an button instead.
  • Loading branch information
jaspermdegroot committed May 21, 2013
1 parent 1324c7a commit 4e864be
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 42 deletions.
55 changes: 29 additions & 26 deletions css/themes/default/jquery.mobile.theme.css
Expand Up @@ -35,30 +35,6 @@ legend,
text-decoration: none;
}

/* Shadow
-----------------------------------------------------------------------------------------------------------*/

.ui-shadow {
-webkit-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/;
-moz-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/;
box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/
}
.ui-shadow-inset {
-webkit-box-shadow: inset 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/;
-moz-box-shadow: inset 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/;
box-shadow: inset 0 1px 3px 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/;
}
.ui-shadow-icon:after {
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,.3) /*{global-icon-shadow}*/;
-moz-box-shadow: 0 1px 0 rgba(255,255,255,.3) /*{global-icon-shadow}*/;
box-shadow: 0 1px 0 rgba(255,255,255,.3) /*{global-icon-shadow}*/;
}
.ui-overlay-shadow {
-webkit-box-shadow: 0 0 12px rgba(0,0,0,.6);
-moz-box-shadow: 0 0 12px rgba(0,0,0,.6);
box-shadow: 0 0 12px rgba(0,0,0,.6);
}

/* Corner rounding
-----------------------------------------------------------------------------------------------------------*/

Expand Down Expand Up @@ -95,6 +71,25 @@ legend,
background-clip: padding-box;
}

/* Shadow
-----------------------------------------------------------------------------------------------------------*/

.ui-shadow {
-webkit-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/;
-moz-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/;
box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/
}
.ui-shadow-inset {
-webkit-box-shadow: inset 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/;
-moz-box-shadow: inset 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/;
box-shadow: inset 0 1px 3px 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.2) /*{global-box-shadow-color}*/;
}
.ui-overlay-shadow {
-webkit-box-shadow: 0 0 12px rgba(0,0,0,.6);
-moz-box-shadow: 0 0 12px rgba(0,0,0,.6);
box-shadow: 0 0 12px rgba(0,0,0,.6);
}

/* Icons
-----------------------------------------------------------------------------------------------------------*/

Expand All @@ -109,7 +104,7 @@ legend,
}

/* Alt icon color */
.ui-btn.ui-icon-alt:after,
.ui-icon-alt.ui-btn:after,
.ui-icon-alt .ui-btn[class*="ui-icon-"]:after,
.ui-icon-alt .ui-input-search:after {
background-color: #fff;
Expand All @@ -119,12 +114,20 @@ legend,
}

/* No disc */
.ui-btn.ui-icon-nodisc:after,
.ui-icon-nodisc.ui-btn:after,
.ui-icon-nodisc .ui-btn[class*="ui-icon-"]:after,
.ui-icon-nodisc .ui-input-search:after {
background-color: transparent;
}

/* Icon shadow */
.ui-shadow-icon.ui-btn:after,
.ui-shadow-icon .ui-btn[class*="ui-icon-"]:after {
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,.3) /*{global-icon-shadow}*/;
-moz-box-shadow: 0 1px 0 rgba(255,255,255,.3) /*{global-icon-shadow}*/;
box-shadow: 0 1px 0 rgba(255,255,255,.3) /*{global-icon-shadow}*/;
}

/* Icon sprite */

.ui-icon-plus:after {
Expand Down
8 changes: 4 additions & 4 deletions js/jquery.mobile.buttonMarkup.js
Expand Up @@ -21,7 +21,7 @@ var reverseBoolOptionMap = {
"ui-shadow" : "shadow",
"ui-corner-all" : "corners",
"ui-btn-inline" : "inline",
"ui-shadow-icon" : "iconshadow",
"ui-shadow-icon" : "iconshadow", /* TODO: Remove in 1.5 */
"ui-mini" : "mini"
};

Expand Down Expand Up @@ -52,7 +52,7 @@ function optionsToClasses( options, existingClasses ) {
"ui-btn-icon-" + options.iconpos
]);
if ( options.iconshadow ) {
classes.push( "ui-shadow-icon" );
classes.push( "ui-shadow-icon" ); /* TODO: Remove in 1.5 */
}
}

Expand Down Expand Up @@ -220,7 +220,7 @@ $.fn.buttonMarkup.defaults = {
inline: false,
shadow: true,
corners: true,
iconshadow: true,
iconshadow: false, /* TODO: Remove in 1.5. Option deprecated in 1.4. */
mini: false
};

Expand Down Expand Up @@ -249,7 +249,7 @@ function enhanceWithButtonMarkup( idx, el ) {
inline : getAttrFixed( el, "inline", true ),
shadow : getAttrFixed( el, "shadow", true ),
corners : getAttrFixed( el, "corners", true ),
iconshadow: getAttrFixed( el, "iconshadow", true ),
iconshadow: getAttrFixed( el, "iconshadow", true ), /* TODO: Remove in 1.5 */
mini : getAttrFixed( el, "mini", true )
}), el.className.split( " " ) ).sort();

Expand Down
9 changes: 3 additions & 6 deletions js/widgets/forms/button.js
Expand Up @@ -14,7 +14,7 @@ $.widget( "mobile.button", $.mobile.widget, {
theme: null,
icon: null,
iconpos: null,
iconshadow: true,
iconshadow: false, /* TODO: Deprecated in 1.4, remove in 1.5. */
corners: true,
shadow: true,
inline: null,
Expand All @@ -30,14 +30,10 @@ $.widget( "mobile.button", $.mobile.widget, {
if ( isInput ) {
classes += " ui-input-btn";

// TODO: When we have time to test thoroughly--any classes manually applied to the original element should be carried over to the enhanced element, with an `-enhanced` suffix. See https://github.com/jquery/jquery-mobile/issues/3577
/* if ( $el[0].className.length ) {
classes = $el[0].className;
} */
// TODO: data-class and data-id options. See https://github.com/jquery/jquery-mobile/issues/3577
if ( !!~$el[ 0 ].className.indexOf( "ui-btn-left" ) ) {
classes += " ui-btn-left";
}

if ( !!~$el[ 0 ].className.indexOf( "ui-btn-right" ) ) {
classes += " ui-btn-right";
}
Expand Down Expand Up @@ -125,6 +121,7 @@ $.widget( "mobile.button", $.mobile.widget, {
$el.attr( "title", text );
}

/* TODO: Remove in 1.5. */
if ( o.iconshadow ) {
classes += " ui-shadow-icon";
}
Expand Down
9 changes: 3 additions & 6 deletions js/widgets/forms/select.js
Expand Up @@ -18,7 +18,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, $.extend( {
inline: false,
corners: true,
shadow: true,
iconshadow: true,
iconshadow: false, /* TODO: Deprecated in 1.4, remove in 1.5. */
overlayTheme: null,
dividerTheme: null,
hidePlaceholderMenuItems: true,
Expand Down Expand Up @@ -112,11 +112,8 @@ $.widget( "mobile.selectmenu", $.mobile.widget, $.extend( {
button = this.button
.insertBefore( this.select )
.addClass( "ui-btn" +
( options.icon ?
( " ui-icon-" + options.icon + " ui-btn-icon-" + iconpos + ( options.iconshadow ?
" ui-shadow-icon" :
"" ) ) :
"" ) +
( options.icon ? ( " ui-icon-" + options.icon + " ui-btn-icon-" + iconpos +
( options.iconshadow ? " ui-shadow-icon" : "" ) ) : "" ) + /* TODO: Remove in 1.5. */
( options.theme ? " ui-btn-" + options.theme : "" ) +
( options.corners ? " ui-corner-all" : "" ) +
( options.shadow ? " ui-shadow" : "" ) );
Expand Down

0 comments on commit 4e864be

Please sign in to comment.