mirror of
https://github.com/status-im/consul.git
synced 2025-02-23 02:48:19 +00:00
QSA doesn't like searching with sibling selectors, make a sibling
This commit is contained in:
parent
4b46caf77a
commit
46419ac466
@ -70,6 +70,16 @@ const closest = function(sel, el) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const sibling = function(el, name) {
|
||||||
|
let sibling = el;
|
||||||
|
while ((sibling = sibling.nextSibling)) {
|
||||||
|
if (sibling.nodeType === 1) {
|
||||||
|
if (sibling.nodeName.toLowerCase() === name) {
|
||||||
|
return sibling;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* The tabular-collection can contain 'actions' the UI for which
|
* The tabular-collection can contain 'actions' the UI for which
|
||||||
* uses dropdown 'action groups', so a group of different actions.
|
* uses dropdown 'action groups', so a group of different actions.
|
||||||
@ -99,7 +109,7 @@ const change = function(e) {
|
|||||||
// therefore we don't need to calculate
|
// therefore we don't need to calculate
|
||||||
if (e.currentTarget.getAttribute('id') !== 'actions_close') {
|
if (e.currentTarget.getAttribute('id') !== 'actions_close') {
|
||||||
const $tr = closest('tr', e.currentTarget);
|
const $tr = closest('tr', e.currentTarget);
|
||||||
const $group = [...$$('~ ul', e.currentTarget)][0];
|
const $group = sibling(e.currentTarget, 'ul');
|
||||||
const $footer = [...$$('footer[role="contentinfo"]')][0];
|
const $footer = [...$$('footer[role="contentinfo"]')][0];
|
||||||
const groupRect = $group.getBoundingClientRect();
|
const groupRect = $group.getBoundingClientRect();
|
||||||
const footerRect = $footer.getBoundingClientRect();
|
const footerRect = $footer.getBoundingClientRect();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user