mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
Do not search for elements if no previews have been registered
The findNearestEligibleTarget method is now being called with an empty array and thus an empty string as a selector Follow up to I5f293a134521f086c9f62babb9d06cd9c51d7d47 Bug: T355933 Bug: T356186 Bug: T356193 Change-Id: I3af44ae65d5097fc44744838a4edb07552568b17
This commit is contained in:
parent
8e4996485f
commit
51059828bf
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.
|
@ -123,8 +123,11 @@ const elementMatchesSelector = ( element, selector ) => {
|
||||||
* @return {HTMLElement|null}
|
* @return {HTMLElement|null}
|
||||||
*/
|
*/
|
||||||
export function findNearestEligibleTarget( element ) {
|
export function findNearestEligibleTarget( element ) {
|
||||||
const selector = selectors.join( ', ' );
|
if ( selectors.length ) {
|
||||||
return element.closest( selector );
|
const selector = selectors.join( ', ' );
|
||||||
|
return element.closest( selector );
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue