Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/toolbox/toolbox.expose.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,22 @@
if (fn) { return fn.call($.mask); }
}

var mask, exposed, loaded, config, overlayIndex;
var mask, exposed, loaded, config, overlayIndex,
closingNow = false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nabd but in future just change this to be multivar declarations.

i.e.

var mask;
var exposed;

etc

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I think isClosing is a better name



$.mask = {

load: function(conf, els) {

if (closingNow && mask) {
// this calls the fadeOut callback
// and sets closingNow to false
mask.finish();
}

// already loaded ?
if (loaded) { return this; }
if (loaded) { return this; }

// configuration
if (typeof conf == 'string') {
Expand Down Expand Up @@ -169,11 +176,13 @@
// onBeforeClose
if (call(config.onBeforeClose) === false) { return this; }

closingNow = true;
mask.fadeOut(config.closeSpeed, function() {
call(config.onClose);
if (exposed) {
exposed.css({zIndex: overlayIndex});
}
}
closingNow = false;
loaded = false;
});

Expand Down