In my initialization I hedge all links should block using the
In my initialization I hedge all links should block using the
The answer would be to not link the event to the links as below:
$("a:not(.ui-multiselect-none, .ui-multiselect-all, .ui-multiselect-close)").on("click", $.blockUI);
Source: link
Returning a false value will prevent the default option of the link and other events as well:
$("a.ui-multiselect-none, a.ui-multiselect-all, a.ui-multiselect-close").on("click", function(e) {
return false;
});
However if you want to avoid only the action of other events, keeping the default action of the link use this:
$("a.ui-multiselect-none, a.ui-multiselect-all, a.ui-multiselect-close").on("click", function(e) {
e.stopPropagation();
});
Still, it may occur, depending on the way your code is organized, that the above function does not prevent the default link action from being disabled by other functions.
In this case use the first option, with a change: before return false
simulate the default action of the link with window.location.replace(this.href);
.
Still, one last alternative:
$("a").on("click", function () {
var classes = 'ui-multiselect-none ui-multiselect-all ui-multiselect-close'.split(' ');
while (classes.length) {
if (this.hasClass(classes.pop())) {
return true;
}
}
$.blockUI();
});