mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
a minor bugfix...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
109eb5df17
commit
f889ae9326
11
ui/data4.js
11
ui/data4.js
@ -1297,20 +1297,19 @@ var DataPrototype = {
|
|||||||
// Main Data object...
|
// Main Data object...
|
||||||
//
|
//
|
||||||
function Data(json){
|
function Data(json){
|
||||||
|
// in case this is called as a function (without new)...
|
||||||
if(this.constructor.name != 'Data'){
|
if(this.constructor.name != 'Data'){
|
||||||
obj = new Data
|
return new Data(json)
|
||||||
} else {
|
|
||||||
obj = this
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// load initial state...
|
// load initial state...
|
||||||
if(json != null){
|
if(json != null){
|
||||||
obj.loadJSON(json)
|
this.loadJSON(json)
|
||||||
} else {
|
} else {
|
||||||
obj._reset()
|
this._reset()
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj
|
return this
|
||||||
}
|
}
|
||||||
Data.__proto__ = DataClassPrototype
|
Data.__proto__ = DataClassPrototype
|
||||||
Data.prototype = DataPrototype
|
Data.prototype = DataPrototype
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user