mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
chore: eslint no-script-url
This commit is contained in:
committed by
Julian Lam
parent
dad01e3051
commit
9f6a682ca9
@@ -114,7 +114,6 @@
|
|||||||
"prefer-template": "off",
|
"prefer-template": "off",
|
||||||
"no-var": "off",
|
"no-var": "off",
|
||||||
"vars-on-top": "off",
|
"vars-on-top": "off",
|
||||||
"no-script-url": "off",
|
|
||||||
"import/newline-after-import": "off",
|
"import/newline-after-import": "off",
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@@ -446,6 +446,7 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
function ajaxifyAnchors() {
|
function ajaxifyAnchors() {
|
||||||
function hrefEmpty(href) {
|
function hrefEmpty(href) {
|
||||||
|
// eslint-disable-next-line no-script-url
|
||||||
return href === undefined || href === '' || href === 'javascript:;';
|
return href === undefined || href === '' || href === 'javascript:;';
|
||||||
}
|
}
|
||||||
var location = document.location || window.location;
|
var location = document.location || window.location;
|
||||||
@@ -516,6 +517,7 @@ $(document).ready(function () {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-script-url
|
||||||
if (hrefEmpty(this.href) || this.protocol === 'javascript:' || href === '#' || href === '') {
|
if (hrefEmpty(this.href) || this.protocol === 'javascript:' || href === '#' || href === '') {
|
||||||
return e.preventDefault();
|
return e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user