From f0a32ea520eff26cdabf6f9ff09c591d514a559b Mon Sep 17 00:00:00 2001 From: Igor Sfiligoi Date: Fri, 1 Nov 2013 18:51:58 +0000 Subject: Change logic to propery distinguish an array from a generic object --- src/lib/rrdFlot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/rrdFlot.js b/src/lib/rrdFlot.js index 8621234..668f112 100644 --- a/src/lib/rrdFlot.js +++ b/src/lib/rrdFlot.js @@ -640,14 +640,14 @@ function resetWindow() { function populateGraphOptions(me, other) { for (e in other) { if (me[e]!=undefined) { - if (typeof(other[e])=="object") { + if (Object.prototype.toString.call(other[e])=="[object Object]") { me[e]=populateGraphOptions(me[e],other[e]); } else { me[e]=other[e]; } } else { /// create a new one - if (typeof(other[e])=="object") { + if (Object.prototype.toString.call(other[e])=="[object Object]") { // This will do a deep copy me[e]=populateGraphOptions({},other[e]); } else { -- cgit v1.1-4-g5e80