mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
Don't log for documentElement (nodeType 9)
Follow up to Ia011aaf9f8b5b932695da3311f849682c0105cfe Bug: T340081 Change-Id: Ibff26eb90fd650532a7e23ac16232366676c0d15
This commit is contained in:
parent
4507ee5207
commit
bd66abba22
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