From a2e5b2e48844a9cafb87710446ff5e4bf5ac2596 Mon Sep 17 00:00:00 2001 From: Jonathan Wilkes <jon.w.wilkes@gmail.com> Date: Tue, 7 Mar 2017 17:12:00 -0500 Subject: [PATCH] fix dropdown menu on Windows-- it uses nw.js 0.14.7 which didn't include the "forEach" method for DOM nodelists --- pd/nw/dialog_iemgui.html | 8 +++++--- pd/nw/pd_canvas.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pd/nw/dialog_iemgui.html b/pd/nw/dialog_iemgui.html index 07581ab86..cd39e492a 100644 --- a/pd/nw/dialog_iemgui.html +++ b/pd/nw/dialog_iemgui.html @@ -554,11 +554,13 @@ function ok() { function change_width_and_height_labels() { [".mknob_steps", ".mknob_size"].forEach(function(sel) { - document.body.querySelectorAll(sel).forEach(function(e) { + Array.prototype.forEach.call( + document.body.querySelectorAll(sel), function(e) { e.setAttribute("data-i18n", "iem.prop" + sel); }); - document.body.querySelectorAll(sel + "_tt").forEach(function(e) { - e.setAttribute("data-i18n", "[title]iem.prop" + sel + "_tt"); + Array.prototype.forEach.call( + document.body.querySelectorAll(sel + "_tt"), function(e) { + e.setAttribute("data-i18n", "[title]iem.prop" + sel + "_tt"); }); }); } diff --git a/pd/nw/pd_canvas.js b/pd/nw/pd_canvas.js index 399ea05f7..df06e0ff4 100644 --- a/pd/nw/pd_canvas.js +++ b/pd/nw/pd_canvas.js @@ -498,7 +498,7 @@ var canvas_events = (function() { && evt.target.parentNode.parentNode && evt.target.parentNode.parentNode.id === "dropdown_list") { li_array = evt.target.parentNode.querySelectorAll('li'); - li_array.forEach(function(e) { + Array.prototype.forEach.call(li_array, function(e) { e.classList.remove("highlighted"); }); evt.target.classList.add("highlighted"); -- GitLab