No need to call toLowerCase on tagName

上级 ae4e477c
......@@ -429,7 +429,7 @@ const handleInnerClick = (event) => {
for (const pathElement of event.composedPath()) {
/** @type {any} */
const node = pathElement;
if (node.tagName && node.tagName.toLowerCase() === 'a' && node.href) {
if (node.tagName === 'A' && node.href) {
if (node.getAttribute('href') === '#') {
event.view.scrollTo(0, 0);
} else if (node.hash && (node.getAttribute('href') === node.hash || (baseElement && node.href === baseElement.href + node.hash))) {
......@@ -460,7 +460,7 @@ const handleAuxClick =
for (const pathElement of event.composedPath()) {
/** @type {any} */
const node = pathElement;
if (node.tagName && node.tagName.toLowerCase() === 'a' && node.href) {
if (node.tagName === 'A' && node.href) {
event.preventDefault();
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册