Permalink
Browse files

Popup: Add option "class" which applies classes to the container (i.e…

…., to widget()).
  • Loading branch information...
gabrielschulhof committed Jul 3, 2013
1 parent 462b2dd commit a518749728f26adb84b053c601733eeb01bd563d
Showing with 9 additions and 0 deletions.
  1. +9 −0 js/widgets/popup.js
View
@@ -54,6 +54,7 @@ function windowCoords() {
$.widget( "mobile.popup", $.mobile.widget, {
options: {
+ class: null,
theme: null,
overlayTheme: null,
shadow: true,
@@ -236,6 +237,7 @@ $.widget( "mobile.popup", $.mobile.widget, {
// Define instance variables
$.extend( this, {
+ _containerClasses: "",
_scrollTop: 0,
_page: thisPage,
_ui: ui,
@@ -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" );
}

0 comments on commit a518749

Please sign in to comment.