Skip to content

Commit

Permalink
Fixing Reveal bug with modals locking when target is clicked while mo…
Browse files Browse the repository at this point in the history
…dal is open
  • Loading branch information
Arthur committed Jul 15, 2014
1 parent 4bbca12 commit 1c966e7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion js/foundation/foundation.reveal.js
Expand Up @@ -48,7 +48,9 @@
.off('.reveal')
.on('click.fndtn.reveal', '[' + this.add_namespace('data-reveal-id') + ']:not([disabled])', function (e) {
e.preventDefault();

// e.stopPropagation();
// if ($('#' + $(self).data('reveal-id'))[0] == $('[data-reveal].open')[0]) return;

if (!self.locked) {
var element = S(this),
ajax = element.data(self.data_attr('reveal-ajax'));
Expand Down Expand Up @@ -134,10 +136,12 @@
return true;
},


open : function (target, ajax_settings) {
var self = this,
modal;


if (target) {
if (typeof target.selector !== 'undefined') {
// Find the named node; only use the first one found, since the rest of the code assumes there's only one node
Expand All @@ -154,6 +158,11 @@
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');

Expand Down

0 comments on commit 1c966e7

Please sign in to comment.