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

Commit

Permalink
Changed getInheritedTheme fallback to swatch "a"
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspermdegroot committed Apr 9, 2013
1 parent e6e8d04 commit 08bcd6c
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions js/jquery.mobile.buttonMarkup.js
Expand Up @@ -31,7 +31,7 @@ $.fn.buttonMarkup = function( options ) {
o = $.extend( {}, $.fn.buttonMarkup.defaults, {
icon: options.icon !== undefined ? options.icon : getAttrFixed( e, nsKey + "icon" ),
iconpos: options.iconpos !== undefined ? options.iconpos : getAttrFixed( e, nsKey + "iconpos" ),
theme: options.theme !== undefined ? options.theme : getAttrFixed( e, nsKey + "theme" ) || $.mobile.getInheritedTheme( el, "c" ),
theme: options.theme !== undefined ? options.theme : getAttrFixed( e, nsKey + "theme" ) || $.mobile.getInheritedTheme( el, "a" ),
inline: options.inline !== undefined ? options.inline : getAttrFixed( e, nsKey + "inline" ),
shadow: options.shadow !== undefined ? options.shadow : getAttrFixed( e, nsKey + "shadow" ),
corners: options.corners !== undefined ? options.corners : getAttrFixed( e, nsKey + "corners" ),
Expand Down Expand Up @@ -90,7 +90,7 @@ $.fn.buttonMarkup = function( options ) {

// if not, try to find closest theme container
if ( !o.theme ) {
o.theme = $.mobile.getInheritedTheme( el, "c" );
o.theme = $.mobile.getInheritedTheme( el, "a" );
}

buttonClass = "ui-btn ";
Expand Down
4 changes: 2 additions & 2 deletions js/widgets/collapsible.js
Expand Up @@ -45,7 +45,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
if ( collapsibleSet.length ) {
// Inherit the theme from collapsible-set
if ( !o.theme ) {
o.theme = collapsibleSet.jqmData( "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "c" );
o.theme = collapsibleSet.jqmData( "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "a" );
}
// Inherit the content-theme from collapsible-set
if ( !o.contentTheme ) {
Expand Down Expand Up @@ -76,7 +76,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
} else {
// get inherited theme if not a set and no theme has been set
if ( !o.theme ) {
o.theme = $.mobile.getInheritedTheme( $el, "c" );
o.theme = $.mobile.getInheritedTheme( $el, "a" );
}
}

Expand Down
2 changes: 1 addition & 1 deletion js/widgets/collapsibleSet.js
Expand Up @@ -19,7 +19,7 @@ $.widget( "mobile.collapsibleset", $.mobile.widget, $.extend( {

// Inherit the theme from collapsible-set
if ( !o.theme ) {
o.theme = $.mobile.getInheritedTheme( $el, "c" );
o.theme = $.mobile.getInheritedTheme( $el, "a" );
}
// Inherit the content-theme from collapsible-set
if ( !o.contentTheme ) {
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/button.js
Expand Up @@ -57,7 +57,7 @@ $.widget( "mobile.button", $.mobile.widget, {
// get the inherited theme
// TODO centralize for all widgets
if ( !o.theme ) {
o.theme = $.mobile.getInheritedTheme( $el, "c" );
o.theme = $.mobile.getInheritedTheme( $el, "a" );
}
o.disabled = $el.prop( "disabled" );
o = splitOptions( o );
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/checkboxradio.js
Expand Up @@ -48,7 +48,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, $.extend( {

// If there's no selected theme check the data attr
if ( !o.theme ) {
o.theme = $.mobile.getInheritedTheme( this.element, "c" );
o.theme = $.mobile.getInheritedTheme( this.element, "a" );
}

// Expose for other methods
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/select.js
Expand Up @@ -72,7 +72,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, $.extend( {
this.label = $( "label[for='"+ this.selectID +"']" ).addClass( "ui-select" );
this.isMultiple = this.select[ 0 ].multiple;
if ( !this.options.theme ) {
this.options.theme = $.mobile.getInheritedTheme( this.select, "c" );
this.options.theme = $.mobile.getInheritedTheme( this.select, "a" );
}
},

Expand Down
4 changes: 2 additions & 2 deletions js/widgets/forms/slider.js
Expand Up @@ -31,7 +31,7 @@ $.widget( "mobile.slider", $.mobile.widget, $.extend( {
// TODO: Each of these should have comments explain what they're for
var self = this,
control = this.element,
parentTheme = $.mobile.getInheritedTheme( control, "c" ),
parentTheme = $.mobile.getInheritedTheme( control, "a" ),
theme = this.options.theme || parentTheme,
trackTheme = this.options.trackTheme || parentTheme,
cType = control[ 0 ].nodeName.toLowerCase(),
Expand Down Expand Up @@ -356,7 +356,7 @@ $.widget( "mobile.slider", $.mobile.widget, $.extend( {
// alteration of the input value, which should still update the slider

var self = this,
parentTheme = $.mobile.getInheritedTheme( this.element, "c" ),
parentTheme = $.mobile.getInheritedTheme( this.element, "a" ),
theme = this.options.theme || parentTheme,
trackTheme = this.options.trackTheme || parentTheme,
left, width, data, tol;
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/slider.tooltip.js
Expand Up @@ -65,7 +65,7 @@ $.widget( "mobile.slider", $.mobile.slider, {
} else if ( key === "popupEnabled" ) {
if ( value && !this._popup ) {
this._popup = getPopup()
.addClass( "ui-body-" + ( this.options.theme || $.mobile.getInheritedTheme( this.element, "c" ) ) )
.addClass( "ui-body-" + ( this.options.theme || $.mobile.getInheritedTheme( this.element, "a" ) ) )
.insertBefore( this.element );
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/forms/textinput.js
Expand Up @@ -27,7 +27,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
var self = this,
input = this.element,
o = this.options,
theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
theme = o.theme || $.mobile.getInheritedTheme( this.element, "a" ),
themeclass = " ui-body-" + theme,
miniclass = o.mini ? " ui-mini" : "",
isSearch = input.is( "[type='search'], :jqmData(type='search')" ),
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/listview.js
Expand Up @@ -134,7 +134,7 @@ $.widget( "mobile.listview", $.mobile.widget, $.extend( {
}

if ( !o.theme ) {
o.theme = $.mobile.getInheritedTheme( this.element, "c" );
o.theme = $.mobile.getInheritedTheme( this.element, "a" );
}

for ( var pos = 0, numli = li.length; pos < numli; pos++ ) {
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/popup.arrow.js
Expand Up @@ -58,7 +58,7 @@ $.widget( "mobile.popup", $.mobile.popup, {
_updateArrow: function( direction ) {
var ar = this._ui.arrow,
oldTheme = ar.ct.jqmData( "oldTheme" ),
theme = "ui-body-" + ( this.options.theme || $.mobile.getInheritedTheme( this.element, "c" ) );
theme = "ui-body-" + ( this.options.theme || $.mobile.getInheritedTheme( this.element, "a" ) );

// Remove old direction and theme
ar.ct.removeClass( "l t r b" );
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/popup.js
Expand Up @@ -611,7 +611,7 @@ define( [
this._applyTransition( o.transition );

if ( !this.options.theme ) {
this._setTheme( this._page.jqmData( "theme" ) || $.mobile.getInheritedTheme( this._page, "c" ) );
this._setTheme( this._page.jqmData( "theme" ) || $.mobile.getInheritedTheme( this._page, "a" ) );
}

this._ui.screen.removeClass( "ui-screen-hidden" );
Expand Down

0 comments on commit 08bcd6c

Please sign in to comment.