moved the Data init code to ._reset() instance method (still thinking about it)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-03-20 01:36:23 +04:00
parent 2a8d005f52
commit f936060d3e

View File

@ -131,6 +131,16 @@ var DataClassPrototype = {
// NOTE: ribbons are sparse...
//
var DataPrototype = {
_reset: function(){
this.base = null
this.current = null
this.order = []
this.ribbon_order = []
this.ribbons = {}
this._gid_cache = []
},
// util methods...
compactSparseList: function(list){
return list.filter(function(){return true})
@ -900,17 +910,11 @@ function Data(json){
obj = this
}
obj.base = null
obj.current = null
obj.order = []
obj.ribbon_order = []
obj.ribbons = {}
obj._gid_cache = []
// load initial state...
if(json != null){
obj.loadJSON(json)
} else {
obj._reset()
}
return obj