mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 08:50:33 +00:00
Merge "Don't log for documentElement (nodeType 9)"
This commit is contained in:
commit
5edfaad0f0
BIN
resources/dist/index.js
vendored
BIN
resources/dist/index.js
vendored
Binary file not shown.
BIN
resources/dist/index.js.map.json
vendored
BIN
resources/dist/index.js.map.json
vendored
Binary file not shown.
11
src/index.js
11
src/index.js
|
@ -145,6 +145,12 @@ function handleDOMEventIfEligible( handler ) {
|
|||
target = target.parentNode;
|
||||
}
|
||||
|
||||
// If the event bubbles up all the way,
|
||||
// document does not have closest method, so exit early (T336650).
|
||||
if ( target === document ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If the closest method is not defined, let's return early and
|
||||
// understand this better by logging an error. (T340081)
|
||||
if ( target && !target.closest ) {
|
||||
|
@ -153,11 +159,6 @@ function handleDOMEventIfEligible( handler ) {
|
|||
return;
|
||||
}
|
||||
|
||||
// If the event bubbles up all the way,
|
||||
// document does not have closest method, so exit early (T336650).
|
||||
if ( target === document ) {
|
||||
return;
|
||||
}
|
||||
target = findNearestEligibleTarget( target );
|
||||
if ( target === null ) {
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue