X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/befc2441c91ddbd8eea67b8d8de48cc281a4bbce..198be737937aec7259e81ba791bf7f4e401795eb:/platforma/static/js/jquery.blockui.js?ds=inline diff --git a/platforma/static/js/jquery.blockui.js b/platforma/static/js/jquery.blockui.js index d0230544..d2da4bcb 100644 --- a/platforma/static/js/jquery.blockui.js +++ b/platforma/static/js/jquery.blockui.js @@ -1,6 +1,6 @@ /*! * jQuery blockUI plugin - * Version 2.28 (02-DEC-2009) + * Version 2.31 (06-JAN-2010) * @requires jQuery v1.2.3 or later * * Examples at: http://malsup.com/jquery/block/ @@ -21,6 +21,8 @@ if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) { $.fn._fadeIn = $.fn.fadeIn; +var noOp = function() {}; + // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle // retarded userAgent strings on Vista) var mode = document.documentMode || 0; @@ -63,7 +65,7 @@ $.fn.unblock = function(opts) { }); }; -$.blockUI.version = 2.28; // 2nd generation blocking at no extra cost! +$.blockUI.version = 2.31; // 2nd generation blocking at no extra cost! // override these in your code to change the default behavior and style $.blockUI.defaults = { @@ -164,6 +166,9 @@ $.blockUI.defaults = { // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) applyPlatformOpacityRules: true, + + // callback method invoked when fadeIn has completed and blocking message is visible + onBlock: null, // callback method invoked when unblocking has completed; the callback is // passed the element that has been unblocked (which is the window object for page @@ -252,7 +257,11 @@ function install(el, opts) { if ($.browser.msie || opts.forceIframe) lyr1.css('opacity',0.0); - $([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); + //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); + var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el); + $.each(layers, function() { + this.appendTo($par); + }); if (opts.theme && opts.draggable && $.fn.draggable) { lyr3.draggable({ @@ -312,16 +321,21 @@ function install(el, opts) { if (($.browser.msie || opts.forceIframe) && opts.showOverlay) lyr1.show(); // opacity is zero if (opts.fadeIn) { + var cb = opts.onBlock ? opts.onBlock : noOp; + var cb1 = (opts.showOverlay && !msg) ? cb : noOp; + var cb2 = msg ? cb : noOp; if (opts.showOverlay) - lyr2._fadeIn(opts.fadeIn); + lyr2._fadeIn(opts.fadeIn, cb1); if (msg) - lyr3.fadeIn(opts.fadeIn); + lyr3._fadeIn(opts.fadeIn, cb2); } else { if (opts.showOverlay) lyr2.show(); if (msg) lyr3.show(); + if (opts.onBlock) + opts.onBlock(); } // bind key and mouse events @@ -460,4 +474,4 @@ function sz(el, p) { return parseInt($.css(el,p))||0; }; -})(jQuery); +})(jQuery); \ No newline at end of file