Skip to content
This repository
Browse code

[popup] Use ui-overlay-* for overlay theme

  • Loading branch information...
commit b9768954d7482b4236932affe1771b673d6e767d 1 parent 52f2eaf
Gabriel "_|Nix|_" Schulhof authored August 13, 2012
1  css/structure/jquery.mobile.popup.css
@@ -3,7 +3,6 @@
3 3
 	left: 0;
4 4
 	width: 100%;
5 5
 	height: 100%;
6  
-	border: 0;
7 6
 	position: absolute;
8 7
 	filter: Alpha(Opacity=50);
9 8
 	opacity: 0;
12  js/widgets/popup.js
@@ -182,7 +182,7 @@ define( [ "jquery",
182 182
 			});
183 183
 		},
184 184
 
185  
-		_applyTheme: function( dst, theme ) {
  185
+		_applyTheme: function( dst, theme, prefix ) {
186 186
 			var classes = ( dst.attr( "class" ) || "").split( " " ),
187 187
 				alreadyAdded = true,
188 188
 				currentTheme = null,
@@ -191,7 +191,7 @@ define( [ "jquery",
191 191
 
192 192
 			while ( classes.length > 0 ) {
193 193
 				currentTheme = classes.pop();
194  
-				matches = currentTheme.match( /^ui-body-([a-z])$/ );
  194
+				matches = ( new RegExp( "^ui-" + prefix + "-([a-z])$" ) ).exec( currentTheme );
195 195
 				if ( matches && matches.length > 1 ) {
196 196
 					currentTheme = matches[ 1 ];
197 197
 					break;
@@ -201,19 +201,19 @@ define( [ "jquery",
201 201
 			}
202 202
 
203 203
 			if ( theme !== currentTheme ) {
204  
-				dst.removeClass( "ui-body-" + currentTheme );
  204
+				dst.removeClass( "ui-" + prefix + "-" + currentTheme );
205 205
 				if ( ! ( theme === null || theme === "none" ) ) {
206  
-					dst.addClass( "ui-body-" + themeStr );
  206
+					dst.addClass( "ui-" + prefix + "-" + themeStr );
207 207
 				}
208 208
 			}
209 209
 		},
210 210
 
211 211
 		_setTheme: function( value ) {
212  
-			this._applyTheme( this.element, value );
  212
+			this._applyTheme( this.element, value, "body" );
213 213
 		},
214 214
 
215 215
 		_setOverlayTheme: function( value ) {
216  
-			this._applyTheme( this._ui.screen, value );
  216
+			this._applyTheme( this._ui.screen, value, "overlay" );
217 217
 
218 218
 			if ( $.mobile.browser.ie ) {
219 219
 				this._ui.screen.toggleClass(

0 notes on commit b976895

Please sign in to comment.
Something went wrong with that request. Please try again.