]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Hide Reveal overlay after the modal when using Motion UI
authorJérôme Lebleu <jerome@maroufle.fr>
Tue, 7 Mar 2017 11:49:59 +0000 (12:49 +0100)
committerJérôme Lebleu <jerome@maroufle.fr>
Tue, 7 Mar 2017 11:49:59 +0000 (12:49 +0100)
js/foundation.reveal.js

index b18538addf66a39a3b8fd3fdaa5cc3a1a4bc4491..6bf4e7d15c64a5924c1ffb610d2e9cea8e1cad73 100644 (file)
@@ -368,18 +368,17 @@ class Reveal {
 
     // Motion UI method of hiding
     if (this.options.animationOut) {
-      if (this.options.overlay) {
-        Foundation.Motion.animateOut(this.$overlay, 'fade-out', finishUp);
-      }
-      else {
-        finishUp();
-      }
-
-      Foundation.Motion.animateOut(this.$element, this.options.animationOut);
+      Foundation.Motion.animateOut(this.$element, this.options.animationOut, () => {
+        if (this.options.overlay) {
+          Foundation.Motion.animateOut(this.$overlay, 'fade-out', finishUp);
+        }
+        else {
+          finishUp();
+        }
+      });
     }
     // jQuery method of hiding
     else {
-
       this.$element.hide(this.options.hideDelay);
 
       if (this.options.overlay) {