diff --git a/web/compatibility.js b/web/compatibility.js index 9f139b7dd..b63ba35d8 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -234,3 +234,21 @@ console = {log: function() {}}; } })(); + +// Check console compatability +(function checkOnClickCompatibility() { + // workaround for reported Opera bug DSK-354448: + // onclick fires on disabled buttons with opaque content + function ignoreIfTargetDisabled(event) { + if (isDisabled(event.target)) { + event.stopPropagation(); + } + } + function isDisabled(node) { + return node.disabled || (node.parentNode && isDisabled(node.parentNode)); + } + if (navigator.userAgent.indexOf('Opera') != -1) { + // use browser detection since we cannot feature-check this bug + document.addEventListener('click', ignoreIfTargetDisabled, true); + } +})(); \ No newline at end of file