Use ES6 for custom script
This commit is contained in:
parent
5c32de523a
commit
4cbdb0bc54
1 changed files with 2 additions and 3 deletions
|
@ -1,11 +1,10 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
// Explicitely not using ES 6 features because the compressor doesn't support them.
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
var adminLinkElement = document.querySelector("a#admin-link");
|
const adminLinkElement = document.querySelector("a#admin-link");
|
||||||
if (adminLinkElement === undefined || adminLinkElement === null) {
|
if (adminLinkElement === undefined || adminLinkElement === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var adminLocation = adminLinkElement.href;
|
const adminLocation = adminLinkElement.href;
|
||||||
document.addEventListener("keydown", function(event) {
|
document.addEventListener("keydown", function(event) {
|
||||||
if (event.code === "KeyE") {
|
if (event.code === "KeyE") {
|
||||||
window.location = adminLocation;
|
window.location = adminLocation;
|
||||||
|
|
Reference in a new issue