// 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) {