mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-30 18:34:40 +00:00
Don't log for documentElement (nodeType 9)
Follow up to Ia011aaf9f8b5b932695da3311f849682c0105cfe Bug: T340081 Change-Id: Ibff26eb90fd650532a7e23ac16232366676c0d15
This commit is contained in:
parent
a80d2b1f56
commit
5af31b5524
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;
|
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
|
// If the closest method is not defined, let's return early and
|
||||||
// understand this better by logging an error. (T340081)
|
// understand this better by logging an error. (T340081)
|
||||||
if ( target && !target.closest ) {
|
if ( target && !target.closest ) {
|
||||||
|
@ -153,11 +159,6 @@ function handleDOMEventIfEligible( handler ) {
|
||||||
return;
|
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 );
|
target = findNearestEligibleTarget( target );
|
||||||
if ( target === null ) {
|
if ( target === null ) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue