diff --git a/package.json b/package.json new file mode 100644 index 0000000..2ae5cd5 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "jquerytools", + "version": "1.2.9-bw-npm", + "description": "[jQuery Tools](http://flowplayer.org/tools/) - The Missing UI library for the Web ================================", + "main": "index.js", + "directories": { + "lib": "lib", + "test": "test" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/BrandwatchLtd/jquerytools.git" + }, + "author": "", + "bugs": { + "url": "https://github.com/BrandwatchLtd/jquerytools/issues" + }, + "homepage": "https://github.com/BrandwatchLtd/jquerytools#readme" +} diff --git a/src/overlay/overlay.js b/src/overlay/overlay.js index 5ecc65e..37e6b30 100644 --- a/src/overlay/overlay.js +++ b/src/overlay/overlay.js @@ -134,8 +134,8 @@ // position & dimensions var top = conf.top, left = conf.left, - oWidth = overlay.outerWidth({margin:true}), - oHeight = overlay.outerHeight({margin:true}); + oWidth = overlay.outerWidth(true), + oHeight = overlay.outerHeight(true); if (typeof top == 'string') { top = top == 'center' ? Math.max((w.height() - oHeight) / 2, 0) : diff --git a/src/toolbox/toolbox.expose.js b/src/toolbox/toolbox.expose.js index 2525f88..61610f8 100644 --- a/src/toolbox/toolbox.expose.js +++ b/src/toolbox/toolbox.expose.js @@ -62,15 +62,22 @@ if (fn) { return fn.call($.mask); } } - var mask, exposed, loaded, config, overlayIndex; + var mask, exposed, loaded, config, overlayIndex, + closingNow = false; $.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') { @@ -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; });