From c9370c43268664be14a67f139137c8cc7affa71a Mon Sep 17 00:00:00 2001 From: Kensuke Matsuzaki Date: Fri, 18 Jul 2014 14:45:24 +0900 Subject: [PATCH] Fix jQuery BlockUI Plugin --- jquery.blockUI/jquery.blockUI-tests.ts | 14 ++++++++++++++ jquery.blockUI/jquery.blockUI.d.ts | 10 +++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/jquery.blockUI/jquery.blockUI-tests.ts b/jquery.blockUI/jquery.blockUI-tests.ts index 19372976fc..234340b938 100644 --- a/jquery.blockUI/jquery.blockUI-tests.ts +++ b/jquery.blockUI/jquery.blockUI-tests.ts @@ -9,3 +9,17 @@ $.blockUI(opt); $.unblockUI(); $("#test").block().unblock(); $("#test").block(opt); + +$.blockUI.defaults.css.border = '5px solid red'; +$.blockUI.defaults.fadeOut = 200; + +$.blockUI({ message: $('#domMessage') }); +$.unblockUI({ fadeOut: 200 }); + +$.blockUI({ + fadeIn: 1000, + timeout: 2000, + onBlock: function() { + alert('Page is now blocked; fadeIn complete'); + } +}); diff --git a/jquery.blockUI/jquery.blockUI.d.ts b/jquery.blockUI/jquery.blockUI.d.ts index 5b1df3f7be..259044eaf8 100644 --- a/jquery.blockUI/jquery.blockUI.d.ts +++ b/jquery.blockUI/jquery.blockUI.d.ts @@ -7,7 +7,7 @@ interface JQBlockUIOptions { /** message displayed when blocking (use null for no message) */ - message?: string; + message?: any; /** title string; only used when theme == true */ title?: string; /** only used when theme == true (requires jquery-ui.js to be loaded) */ @@ -76,7 +76,7 @@ interface JQBlockUIOptions { focusInput?: boolean; /** callback method invoked when fadeIn has completed and blocking message is visible */ - onBlock?: boolean; + onBlock?: () => void; /** * callback method invoked when unblocking has completed; the callback is @@ -99,7 +99,7 @@ interface JQBlockUIOptions { interface JQBlockUIStatic { /** default options */ - default?: JQBlockUIOptions; + defaults?: JQBlockUIOptions; /** block user activity for the page */ (): void; /** @@ -113,7 +113,7 @@ interface JQueryStatic { /** block user activity for the page */ blockUI?: JQBlockUIStatic; /** unblock the page */ - unblockUI?: () => void; + unblockUI?: JQBlockUIStatic; } interface JQuery { @@ -125,5 +125,5 @@ interface JQuery { /** * unblock the element(s) */ - unblock(): JQuery; + unblock(option?: JQBlockUIOptions): JQuery; } \ No newline at end of file