From 4cbdb0bc5458715a0a836a6e9cc7ab0bbc1bbacc Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sun, 21 Mar 2021 15:39:31 +0100 Subject: [PATCH] Use ES6 for custom script --- articles/static/edit-keymap.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/articles/static/edit-keymap.js b/articles/static/edit-keymap.js index b0fbd21..bf2a8d4 100644 --- a/articles/static/edit-keymap.js +++ b/articles/static/edit-keymap.js @@ -1,11 +1,10 @@ 'use strict'; -// Explicitely not using ES 6 features because the compressor doesn't support them. window.onload = function () { - var adminLinkElement = document.querySelector("a#admin-link"); + const adminLinkElement = document.querySelector("a#admin-link"); if (adminLinkElement === undefined || adminLinkElement === null) { return; } - var adminLocation = adminLinkElement.href; + const adminLocation = adminLinkElement.href; document.addEventListener("keydown", function(event) { if (event.code === "KeyE") { window.location = adminLocation;