From f889ae9326478f2b0268c6d17704164440ed632b Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 26 May 2014 13:42:59 +0400 Subject: [PATCH] a minor bugfix... Signed-off-by: Alex A. Naanou --- ui/data4.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ui/data4.js b/ui/data4.js index 427716d0..f87ed9cf 100755 --- a/ui/data4.js +++ b/ui/data4.js @@ -1297,20 +1297,19 @@ var DataPrototype = { // Main Data object... // function Data(json){ + // in case this is called as a function (without new)... if(this.constructor.name != 'Data'){ - obj = new Data - } else { - obj = this + return new Data(json) } // load initial state... if(json != null){ - obj.loadJSON(json) + this.loadJSON(json) } else { - obj._reset() + this._reset() } - return obj + return this } Data.__proto__ = DataClassPrototype Data.prototype = DataPrototype