diff options
Diffstat (limited to 'addons/web/static/src/js/core')
| -rw-r--r-- | addons/web/static/src/js/core/dom.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/core/domain.js | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/core/misc.js | 25 |
3 files changed, 27 insertions, 2 deletions
diff --git a/addons/web/static/src/js/core/dom.js b/addons/web/static/src/js/core/dom.js index 115cc5fcf0c..9280b9a0884 100644 --- a/addons/web/static/src/js/core/dom.js +++ b/addons/web/static/src/js/core/dom.js @@ -438,7 +438,7 @@ return { } }, /** - * Cleans what has been done by `initAutoMoreMenu'. + * Cleans what has been done by ``initAutoMoreMenu``. * * @param {jQuery} $el */ diff --git a/addons/web/static/src/js/core/domain.js b/addons/web/static/src/js/core/domain.js index 5ebc6bd22c9..01d9aaee8ff 100644 --- a/addons/web/static/src/js/core/domain.js +++ b/addons/web/static/src/js/core/domain.js @@ -458,7 +458,7 @@ var Domain = collections.Tree.extend({ * Converts python condition to a JS prefix-array representation of a domain * * @static - * @param {string} domain + * @param {string} condition * @returns {Array} */ conditionToDomain: function (condition) { diff --git a/addons/web/static/src/js/core/misc.js b/addons/web/static/src/js/core/misc.js index be0f012752c..cd9a73ef22b 100644 --- a/addons/web/static/src/js/core/misc.js +++ b/addons/web/static/src/js/core/misc.js @@ -52,6 +52,29 @@ if ($.blockUI) { } +/** + * Remove the "accesskey" attributes to avoid the use of the access keys + * while the blockUI is enable. + */ + +function blockAccessKeys() { + var elementWithAccessKey = []; + elementWithAccessKey = document.querySelectorAll('[accesskey]'); + _.each(elementWithAccessKey, function (elem) { + elem.setAttribute("data-accesskey",elem.getAttribute('accesskey')); + elem.removeAttribute('accesskey'); + }); +} + +function unblockAccessKeys() { + var elementWithDataAccessKey = []; + elementWithDataAccessKey = document.querySelectorAll('[data-accesskey]'); + _.each(elementWithDataAccessKey, function (elem) { + elem.setAttribute('accesskey', elem.getAttribute('data-accesskey')); + elem.removeAttribute('data-accesskey'); + }); +} + var throbbers = []; function blockUI() { @@ -60,6 +83,7 @@ function blockUI() { throbbers.push(throbber); throbber.appendTo($(".oe_blockui_spin_container")); $(document.body).addClass('o_ui_blocked'); + blockAccessKeys(); return tmp; } @@ -67,6 +91,7 @@ function unblockUI() { _.invoke(throbbers, 'destroy'); throbbers = []; $(document.body).removeClass('o_ui_blocked'); + unblockAccessKeys(); return $.unblockUI.apply($, arguments); } |
