This proto-module adds the possibility of blocking certain UI regions from the user, by adding an overlay and a spinning wheel on top of them. It allows several blockers to be registered and maintains separate counters for each of them.
- jQuery
- jQueryUI (particularly blockUI)
- Underscore
- Dashboards object
All of these are bundled with CDF.
The basic interface is
moduleName.addBlocker( name, selector);
If selector is not passed, the 1st argument will be used as name and selector.
This activates the blocker.
moduleName.incrementRunningCalls( name );
This de-activates the blocker but only when the running calls get to 0.
moduleName.decrementRunningCalls( name );
The increment and decrement functions, when called without an argument, will use the default CDF blocker.
The module methods getBlock and getUnblock return functions that can be used directly to override the base ones provided by CDF UnmanagedComponent. They will be bound to the registered blocker whose name is passed on function creation.