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

Commit a518749

Browse files
author
Gabriel Schulhof
committed
Popup: Add option "class" which applies classes to the container (i.e., to widget()).
1 parent 462b2dd commit a518749

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

js/widgets/popup.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function windowCoords() {
5454

5555
$.widget( "mobile.popup", $.mobile.widget, {
5656
options: {
57+
class: null,
5758
theme: null,
5859
overlayTheme: null,
5960
shadow: true,
@@ -236,6 +237,7 @@ $.widget( "mobile.popup", $.mobile.widget, {
236237

237238
// Define instance variables
238239
$.extend( this, {
240+
_containerClasses: "",
239241
_scrollTop: 0,
240242
_page: thisPage,
241243
_ui: ui,
@@ -305,6 +307,13 @@ $.widget( "mobile.popup", $.mobile.widget, {
305307
var el = this.element,
306308
screen = this._ui.screen;
307309

310+
if ( o.class !== undefined ) {
311+
this._ui.container
312+
.removeClass( this._containerClasses )
313+
.addClass( o.class );
314+
this._containerClasses = o.class;
315+
}
316+
308317
if ( o.theme !== undefined ) {
309318
this._applyTheme( el, o.theme, "body" );
310319
}

0 commit comments

Comments
 (0)