From f68acca42757a8f095e2712e40af495cdeaa5e7a Mon Sep 17 00:00:00 2001
From: Nick O'Leary <nick.oleary@gmail.com>
Date: Thu, 1 Dec 2016 15:27:29 +0000
Subject: [PATCH] Fix dynamically loading multiple node-sets from palette
 editor

---
 editor/js/main.js | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/editor/js/main.js b/editor/js/main.js
index 22726bec0..d2e438fed 100644
--- a/editor/js/main.js
+++ b/editor/js/main.js
@@ -98,11 +98,9 @@
                     var i,m;
                     var typeList;
                     var info;
-
                     if (topic == "node/added") {
                         var addedTypes = [];
-                        for (i=0;i<msg.length;i++) {
-                            m = msg[i];
+                        msg.forEach(function(m) {
                             var id = m.id;
                             RED.nodes.addNodeSet(m);
                             addedTypes = addedTypes.concat(m.types);
@@ -111,7 +109,7 @@
                                     $("body").append(data);
                                 });
                             });
-                        }
+                        });
                         if (addedTypes.length) {
                             typeList = "<ul><li>"+addedTypes.join("</li><li>")+"</li></ul>";
                             RED.notify(RED._("palette.event.nodeAdded", {count:addedTypes.length})+typeList,"success");