From 44798289cc28ff5150e3f94dbe11c02b5d0bc33c Mon Sep 17 00:00:00 2001 From: Indigo744 Date: Thu, 22 Oct 2015 11:33:43 +0200 Subject: [PATCH] Avoid IE8 js error on map update legends is an array containing the legend element. Using "Array.prototype.forEach()" is not valid for IE8 (and maybe others?). To fix the problem, I use jQuery.each() function (http://api.jquery.com/jQuery.each). Issue doesn't appears anymore. --- js/jquery.mapael.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/jquery.mapael.js b/js/jquery.mapael.js index 8aada64..e92e8ba 100644 --- a/js/jquery.mapael.js +++ b/js/jquery.mapael.js @@ -222,12 +222,12 @@ , elemOptions = {}; // Reset hidden map elements (when user click on legend elements) - legends.forEach(function(el) { + $.each(legends, function(index, el) { el.forEach && el.forEach(function(el) { if(typeof el.hidden != "undefined" && el.hidden == true) { $(el.node).trigger("click"); } - }) + }); }); if (typeof opt != "undefined") {