vendor/assets/javascripts/foundation/foundation.reveal.js in foundation-rails-5.3.0.1 vs vendor/assets/javascripts/foundation/foundation.reveal.js in foundation-rails-5.3.1.0
- old
+ new
@@ -2,11 +2,11 @@
'use strict';
Foundation.libs.reveal = {
name : 'reveal',
- version : '5.3.0',
+ version : '5.3.1',
locked : false,
settings : {
animation: 'fadeAndPop',
@@ -46,11 +46,11 @@
S(this.scope)
.off('.reveal')
.on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']:not([disabled])', function (e) {
e.preventDefault();
-
+
if (!self.locked) {
var element = S(this),
ajax = element.data(self.data_attr('reveal-ajax'));
self.locked = true;
@@ -132,10 +132,11 @@
key_up_off : function (scope) {
this.S('body').off('keyup.fndtn.reveal');
return true;
},
+
open : function (target, ajax_settings) {
var self = this,
modal;
if (target) {
@@ -152,10 +153,15 @@
}
var settings = modal.data(self.attr_name(true) + '-init');
settings = settings || this.settings;
+
+ if (modal.hasClass('open') && target.attr('data-reveal-id') == modal.attr('id')) {
+ return self.close(modal);
+ }
+
if (!modal.hasClass('open')) {
var open_modal = self.S('[' + self.attr_name() + '].open');
if (typeof modal.data('css-top') === 'undefined') {
modal.data('css-top', parseInt(modal.css('top'), 10))
@@ -371,10 +377,10 @@
var video = $('.flex-video', e.target),
iframe = $('iframe', video);
if (iframe.length > 0) {
iframe.attr('data-src', iframe[0].src);
- iframe.attr('src', 'about:blank');
+ iframe.attr('src', iframe.attr('src'));
video.hide();
}
},
open_video : function (e) {