From b22244d6d0dc8d3e4cf124eadb09cb09d9574f24 Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Sun, 22 Feb 2015 16:28:26 +0200 Subject: web client: ignore navigation events when UI is blocked eliminates race condition when sorting list elements by dragging from an anchor --- web/blocking.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 web/blocking.js (limited to 'web/blocking.js') diff --git a/web/blocking.js b/web/blocking.js new file mode 100644 index 0000000..d45992f --- /dev/null +++ b/web/blocking.js @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2012-2015 Kaarle Ritvanen + * See LICENSE file for license details + */ + +define(["jquery", "jquery-blockui"], function($) { + var enabled = false; + + return { + enable: function() { + $.blockUI(); + enabled = true; + }, + disable: function() { + $.unblockUI(); + enabled = false; + }, + isEnabled: function() { return enabled; } + }; +}); -- cgit v1.2.3