Skip to content

Commit

Permalink
Update www/js/lib/uiUtil.js
Browse files Browse the repository at this point in the history
Co-authored-by: Jaifroid <[email protected]>
  • Loading branch information
mossroy and Jaifroid authored Jun 2, 2022
1 parent 2e092c3 commit 2bb7544
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions www/js/lib/uiUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,12 @@ define(rqDef, function(settingsStore) {
var currentElement = element;
while (currentElement.tagName !== 'A' && currentElement.tagName !== 'AREA') {
// If there is no parent Element, we did not find any enclosing A tag
if (!currentElement.parentElement)
if (!currentElement.parentElement) {
return;
// Else we try the next parent Element
currentElement = currentElement.parentElement;
} else {
// Else we try the next parent Element
currentElement = currentElement.parentElement;
}
}
// If we reach this line, it means the currentElement is the enclosing Anchor we're looking for
return currentElement;
Expand Down

0 comments on commit 2bb7544

Please sign in to comment.