From 1570dc2d35bf1f8490c1d3efd5083176837ba074 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Tue, 7 Mar 2017 12:49:59 +0100 Subject: [PATCH] Hide Reveal overlay after the modal when using Motion UI --- js/foundation.reveal.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/js/foundation.reveal.js b/js/foundation.reveal.js index b18538add..6bf4e7d15 100644 --- a/js/foundation.reveal.js +++ b/js/foundation.reveal.js @@ -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) { -- 2.47.2