mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 08:50:33 +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
(cherry picked from commit 51059828bf
)
This commit is contained in:
parent
8fc7222b26
commit
4fd7cc93b7
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}
|
||||
*/
|
||||
export function findNearestEligibleTarget( element ) {
|
||||
const selector = selectors.join( ', ' );
|
||||
return element.closest( selector );
|
||||
if ( selectors.length ) {
|
||||
const selector = selectors.join( ', ' );
|
||||
return element.closest( selector );
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue