Skip to content

Commit a7d9182

Browse files
committed
Fixes timing bug introduced by removing default fade animation.
1 parent 78c2d10 commit a7d9182

File tree

2 files changed

+34
-9
lines changed

2 files changed

+34
-9
lines changed

css/structure/jquery.mobile.popup.css

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
.ui-page.ui-popup-open .ui-header-fixed,
2-
.ui-page.ui-popup-open .ui-footer-fixed {
3-
position: absolute;
4-
}
5-
61
.ui-popup-screen {
72
background-image: url(data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==); /* Necessary to set some form of background to ensure element is clickable in IE6/7. While legacy IE won’t understand the data-URI’d image, it ensures no additional requests occur in all other browsers with little overhead. */
83
top: 0px;
@@ -15,14 +10,38 @@
1510
z-index: 1099;
1611
}
1712

18-
.ui-popup-screen.in {
13+
@-webkit-keyframes popup-fadein {
14+
from { opacity: 0; }
15+
to { opacity: 0.5; }
16+
}
17+
18+
@-moz-keyframes popup-fadein {
19+
from { opacity: 0; }
20+
to { opacity: 0.5; }
21+
}
22+
23+
@-webkit-keyframes popup-fadeout {
24+
from { opacity: 0.5; }
25+
to { opacity: 0; }
26+
}
27+
28+
@-moz-keyframes popup-fadeout {
29+
from { opacity: 0.5; }
30+
to { opacity: 0; }
31+
}
32+
33+
.ui-popup-screen.fade.in {
1934
opacity: 0.5;
2035
filter: Alpha(Opacity=50);
36+
-webkit-animation-name: popup-fadein;
37+
-moz-animation-name: popup-fadein;
2138
}
2239

23-
.ui-popup-screen.out {
40+
.ui-popup-screen.fade.out {
2441
opacity: 0;
2542
filter: Alpha(Opacity=0);
43+
-webkit-animation-name: popup-fadeout;
44+
-moz-animation-name: popup-fadeout;
2645
}
2746

2847
.ui-popup-container {

js/widgets/popup.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,12 @@ define( [ "jquery",
412412
_animate: function( args ) {
413413
if ( this.options.overlayTheme && args.additionalCondition ) {
414414
this._ui.screen
415-
.animationComplete( $.proxy( args.prereqs.screen, "resolve" ) )
416415
.removeClass( args.classToRemove )
417416
.addClass( args.screenClassToAdd );
417+
418+
setTimeout(function() {
419+
args.prereqs.screen.resolve();
420+
}, 0);
418421
} else {
419422
args.prereqs.screen.resolve();
420423
}
@@ -424,9 +427,12 @@ define( [ "jquery",
424427
this._applyTransition( args.transition );
425428
}
426429
this._ui.container
427-
.animationComplete( $.proxy( args.prereqs.container, "resolve" ) )
428430
.addClass( args.containerClassToAdd )
429431
.removeClass( args.classToRemove );
432+
433+
setTimeout(function() {
434+
args.prereqs.container.resolve();
435+
}, 0);
430436
} else {
431437
args.prereqs.container.resolve();
432438
}

0 commit comments

Comments
 (0)