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

Commit

Permalink
Popup: Add option "class" which applies classes to the container (i.e…
Browse files Browse the repository at this point in the history
…., to widget()).
  • Loading branch information
Gabriel Schulhof committed Jul 4, 2013
1 parent 462b2dd commit a518749
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/widgets/popup.js
Expand Up @@ -54,6 +54,7 @@ function windowCoords() {

$.widget( "mobile.popup", $.mobile.widget, {
options: {
class: null,
theme: null,
overlayTheme: null,
shadow: true,
Expand Down Expand Up @@ -236,6 +237,7 @@ $.widget( "mobile.popup", $.mobile.widget, {

// Define instance variables
$.extend( this, {
_containerClasses: "",
_scrollTop: 0,
_page: thisPage,
_ui: ui,
Expand Down Expand Up @@ -305,6 +307,13 @@ $.widget( "mobile.popup", $.mobile.widget, {
var el = this.element,
screen = this._ui.screen;

if ( o.class !== undefined ) {
this._ui.container
.removeClass( this._containerClasses )
.addClass( o.class );
this._containerClasses = o.class;
}

if ( o.theme !== undefined ) {
this._applyTheme( el, o.theme, "body" );
}
Expand Down

0 comments on commit a518749

Please sign in to comment.