From 168f8275997644190f3412983e892b0b15c35074 Mon Sep 17 00:00:00 2001 From: "Omar C. F" Date: Mon, 14 May 2018 17:18:43 +0200 Subject: [PATCH] Fix forEach is not a function and use strict Fix `Uncaught TypeError: filesContext.forEach is not a function` with simple wrapper Array created from fileContext Fix the `Block-scoped declarations (let, const, function, class) not yet supported outside strict mode` using strict --- dist/template-app/js/menu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/template-app/js/menu.js b/dist/template-app/js/menu.js index fc86b7c..b462495 100644 --- a/dist/template-app/js/menu.js +++ b/dist/template-app/js/menu.js @@ -23,10 +23,10 @@ menu.append(new MenuItem({ // Add the listener document.addEventListener('DOMContentLoaded', function () { - + "use strict"; let filesContext = document.querySelectorAll('.file_arq'); - filesContext.forEach(function(el){ + Array.from(filesContext).forEach(function(el){ el.addEventListener('click', function (event) { event.preventDefault() menu.popup(remote.getCurrentWindow());