Handle non-elements, like text nodes
This commit is contained in:
parent
9c812157ee
commit
94bcba741b
3
dist/converse.js
vendored
3
dist/converse.js
vendored
@ -69716,7 +69716,8 @@ u.matchesSelector = function (el, selector) {
|
|||||||
* (DOMElement) el - The DOM element
|
* (DOMElement) el - The DOM element
|
||||||
* (String) selector - The selector
|
* (String) selector - The selector
|
||||||
*/
|
*/
|
||||||
return (el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector).call(el, selector);
|
const match = el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector;
|
||||||
|
return match ? match.call(el, selector) : false;
|
||||||
};
|
};
|
||||||
|
|
||||||
u.queryChildren = function (el, selector) {
|
u.queryChildren = function (el, selector) {
|
||||||
|
@ -179,14 +179,15 @@ u.matchesSelector = function (el, selector) {
|
|||||||
* (DOMElement) el - The DOM element
|
* (DOMElement) el - The DOM element
|
||||||
* (String) selector - The selector
|
* (String) selector - The selector
|
||||||
*/
|
*/
|
||||||
return (
|
const match = (
|
||||||
el.matches ||
|
el.matches ||
|
||||||
el.matchesSelector ||
|
el.matchesSelector ||
|
||||||
el.msMatchesSelector ||
|
el.msMatchesSelector ||
|
||||||
el.mozMatchesSelector ||
|
el.mozMatchesSelector ||
|
||||||
el.webkitMatchesSelector ||
|
el.webkitMatchesSelector ||
|
||||||
el.oMatchesSelector
|
el.oMatchesSelector
|
||||||
).call(el, selector);
|
);
|
||||||
|
return match ? match.call(el, selector) : false;
|
||||||
};
|
};
|
||||||
|
|
||||||
u.queryChildren = function (el, selector) {
|
u.queryChildren = function (el, selector) {
|
||||||
|
Loading…
Reference in New Issue
Block a user