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

Commit 274ad2e

Browse files
committed
Unit tests: fixing final tests for switching to toolbar widget
1 parent 66607c4 commit 274ad2e

File tree

6 files changed

+6
-11
lines changed

6 files changed

+6
-11
lines changed

js/jquery.mobile.core.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ define( [ "jquery", "./jquery.mobile.ns", "json!../package.json" ], function( jQ
172172
ltr = "",
173173
re = /ui-(bar|body|overlay)-([a-z])\b/,
174174
c, m;
175-
176175
while ( e ) {
177176
c = e.className || "";
178177
if ( c && ( m = re.exec( c ) ) && ( ltr = m[ 2 ] ) ) {
@@ -183,10 +182,8 @@ define( [ "jquery", "./jquery.mobile.ns", "json!../package.json" ], function( jQ
183182

184183
e = e.parentNode;
185184
}
186-
187185
// Return the theme letter we found, if none, return the
188186
// specified default.
189-
190187
return ltr || defaultTheme || "a";
191188
},
192189

js/widgets/page.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ $.widget( "mobile.page", $.mobile.widget, {
3939
pagebeforeshow: "_handlePageBeforeShow"
4040
});
4141
this.element.find("["+attrPrefix+"role='content']").each( function(){
42-
var $this = $( this );
43-
self.options.contentTheme = self.options.theme || self.options.contentTheme || ( self.element.jqmData("role") === "dialog" && self.options.theme );
42+
var $this = $( this ),
43+
theme = this.getAttribute( attrPrefix + "theme" ) || undefined;
44+
self.options.contentTheme = theme || self.options.contentTheme || ( self.element.jqmData("role") === "dialog" && self.options.theme );
4445
$this.addClass("ui-content");
4546
if ( self.options.contentTheme ) {
4647
$this.addClass( "ui-body-" + ( self.options.contentTheme ) );

tests/integration/dialog/dialog_events.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
module( "jquery.mobile.dialog.js", {
99
setup: function() {
10-
$.mobile.page.prototype.options.contentTheme = "c";
10+
$.mobile.page.prototype.options.contentTheme = "d";
1111
$.testHelper.navReset( homeWithSearch );
1212
}
1313
});
@@ -179,7 +179,6 @@
179179

180180
function() {
181181
var dialog = $( "#dialog-c" );
182-
183182
// Assert dialog theme inheritance (issue 1375):
184183
ok( dialog.hasClass( "ui-body-e" ), "Expected explicit theme ui-body-e" );
185184
ok( dialog.hasClass( "ui-overlay-b" ), "Expected explicit theme ui-overlay-b" );

tests/unit/button/button_core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
var $inherited = $( "#theme-check" ),
3939
$explicit = $( "#theme-check-explicit" );
4040

41-
ok( $inherited.closest("div").hasClass( "ui-btn-up-a" ), "should inherit from page" );
41+
ok( $inherited.closest("div").hasClass( "ui-btn-up-p" ), "should inherit from content" );
4242
ok( $explicit.closest("div").hasClass( "ui-btn-up-b" ), "should not inherit" );
4343
});
4444

tests/unit/fixed-toolbar/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
[
1717
"navigation/method",
1818
"jquery.mobile.buttonMarkup",
19-
"widgets/page",
2019
"widgets/toolbar",
2120
"widgets/fixedToolbar"
2221
],

tests/unit/page-sections/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
<script>
1515
$.testHelper.asyncLoad([
1616
[
17-
"widgets/page",
18-
"widgets/page.sections"
17+
"widgets/toolbar"
1918
],
2019
[
2120
"jquery.mobile.buttonMarkup",

0 commit comments

Comments
 (0)