MDL-75848 editor_atto: fix console error when clicking toolbar menu.

This commit is contained in:
Paul Holden 2022-10-21 18:46:07 +01:00
parent 046e48c49c
commit 3bf355e37a
4 changed files with 8 additions and 8 deletions

View File

@ -601,9 +601,9 @@ EditorPluginButtons.prototype = {
return;
}
// Ensure menu button was clicked, and isn't itself disabled.
var menuButton = e.currentTarget.ancestor('button', true);
if (menuButton.hasAttribute(DISABLED)) {
// Exit early if the clicked button was disabled.
if (menuButton === null || menuButton.hasAttribute(DISABLED)) {
return;
}

File diff suppressed because one or more lines are too long

View File

@ -599,9 +599,9 @@ EditorPluginButtons.prototype = {
return;
}
// Ensure menu button was clicked, and isn't itself disabled.
var menuButton = e.currentTarget.ancestor('button', true);
if (menuButton.hasAttribute(DISABLED)) {
// Exit early if the clicked button was disabled.
if (menuButton === null || menuButton.hasAttribute(DISABLED)) {
return;
}

View File

@ -451,9 +451,9 @@ EditorPluginButtons.prototype = {
return;
}
// Ensure menu button was clicked, and isn't itself disabled.
var menuButton = e.currentTarget.ancestor('button', true);
if (menuButton.hasAttribute(DISABLED)) {
// Exit early if the clicked button was disabled.
if (menuButton === null || menuButton.hasAttribute(DISABLED)) {
return;
}