diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-01-14 12:41:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-14 12:41:56 +0300 |
commit | 7f77fdfd16f4e7d28aa5a3fc92e78469f7bc2fb2 (patch) | |
tree | 19cee1510398e131be3b0d8daee0a77cbedb4e86 /plugins | |
parent | 8574448b755a9f5b430c25a0439f11d63fa63fb6 (diff) |
[Vue] do not use button element in piwikHelper.modalConfirm() if it belongs to another nested modal (#18619)
* do not use button element in piwikHelper.modalConfirm() if it belongs to another nested modal
* forgot to commit
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Morpheus/javascripts/piwikHelper.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/Morpheus/javascripts/piwikHelper.js b/plugins/Morpheus/javascripts/piwikHelper.js index b6e55427e0..548a5a2fb2 100644 --- a/plugins/Morpheus/javascripts/piwikHelper.js +++ b/plugins/Morpheus/javascripts/piwikHelper.js @@ -270,6 +270,17 @@ window.piwikHelper = { $('[role]', domElem).each(function(){ var $button = $(this); + + // skip this button if it's part of another modal, the current modal can launch + // (which is true if there are more than one parent elements contained in domElem, + // w/ css class ui-confirm) + const uiConfirm = $button.parents('.ui-confirm').filter(function () { + return domElem[0] === this || $.contains(domElem[0], this); + }); + if (uiConfirm.length > 1) { + return; + } + var role = $button.attr('role'); var title = $button.attr('title'); var text = $button.val(); |