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

Commit 46eefb8

Browse files
committed
Page: Add set options method
1 parent e34f138 commit 46eefb8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

js/widgets/page.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ $.widget( "mobile.page", $.mobile.widget, {
5454
$.mobile._enhancer.enhance( this.element[ 0 ] );
5555
},
5656

57+
_setOptions: function( o ) {
58+
59+
if( o.theme !== undefined ) {
60+
this.element.removeClass( "ui-body-" + this.options.theme ).addClass( "ui-body-" + o.theme );
61+
}
62+
63+
if( o.contentTheme !== undefined ) {
64+
this.element.find( "[data-" + $.mobile.ns + "='content']" ).removeClass( "ui-body-" + this.options.contentTheme )
65+
.addClass( "ui-body-" + o.contentTheme );
66+
}
67+
},
68+
5769
_handlePageBeforeShow: function(/* e */) {
5870
this.setContainerBackground();
5971
},

0 commit comments

Comments
 (0)