From e5e470f65b393af5da54c0a31715c9dec317cd16 Mon Sep 17 00:00:00 2001 From: pascalposchenrieder Date: Wed, 11 Jul 2018 18:56:15 +0200 Subject: [PATCH] callback onBlock() -> onBlock(element, options) onBlock callback function now gets called with correct this, the block element and the block options --- jquery.blockUI.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.blockUI.js b/jquery.blockUI.js index 90ce5d6..b51f45e 100644 --- a/jquery.blockUI.js +++ b/jquery.blockUI.js @@ -416,9 +416,9 @@ var cb1 = (opts.showOverlay && !msg) ? cb : noOp; var cb2 = msg ? cb : noOp; if (opts.showOverlay) - lyr2._fadeIn(opts.fadeIn, cb1); + lyr2._fadeIn(opts.fadeIn, cb1.bind(lyr2, el, opts)); if (msg) - lyr3._fadeIn(opts.fadeIn, cb2); + lyr3._fadeIn(opts.fadeIn, cb2.bind(lyr3, el, opts)); } else { if (opts.showOverlay) @@ -426,7 +426,7 @@ if (msg) lyr3.show(); if (opts.onBlock) - opts.onBlock.bind(lyr3)(); + opts.onBlock.call(lyr3, el, opts); } // bind key and mouse events