|
|
@ -87,7 +87,7 @@ define(['backbone','./Components', 'SelectorManager/model/Selectors', 'TraitMana |
|
|
|
|
|
|
|
|
this.opt = opt; |
|
|
this.opt = opt; |
|
|
this.sm = opt ? opt.sm || {} : {}; |
|
|
this.sm = opt ? opt.sm || {} : {}; |
|
|
this.config = o || {}; |
|
|
this.config = o || {}; |
|
|
this.defaultC = this.config.components || []; |
|
|
this.defaultC = this.config.components || []; |
|
|
this.defaultCl = this.normalizeClasses(this.get('classes') || this.config.classes || []); |
|
|
this.defaultCl = this.normalizeClasses(this.get('classes') || this.config.classes || []); |
|
|
this.components = new Components(this.defaultC, opt); |
|
|
this.components = new Components(this.defaultC, opt); |
|
|
@ -182,7 +182,7 @@ define(['backbone','./Components', 'SelectorManager/model/Selectors', 'TraitMana |
|
|
* Override original clone method |
|
|
* Override original clone method |
|
|
* @private |
|
|
* @private |
|
|
*/ |
|
|
*/ |
|
|
clone: function() { |
|
|
clone: function(reset) { |
|
|
var attr = _.clone(this.attributes), |
|
|
var attr = _.clone(this.attributes), |
|
|
comp = this.get('components'), |
|
|
comp = this.get('components'), |
|
|
traits = this.get('traits'), |
|
|
traits = this.get('traits'), |
|
|
@ -190,24 +190,24 @@ define(['backbone','./Components', 'SelectorManager/model/Selectors', 'TraitMana |
|
|
attr.components = []; |
|
|
attr.components = []; |
|
|
attr.classes = []; |
|
|
attr.classes = []; |
|
|
attr.traits = []; |
|
|
attr.traits = []; |
|
|
if(comp.length){ |
|
|
|
|
|
comp.each(function(md,i) { |
|
|
comp.each(function(md,i) { |
|
|
attr.components[i] = md.clone(); |
|
|
attr.components[i] = md.clone(1); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
traits.each(function(md, i) { |
|
|
if(traits.length){ |
|
|
attr.traits[i] = md.clone(); |
|
|
traits.each(function(md, i) { |
|
|
}); |
|
|
attr.traits[i] = md.clone(); |
|
|
cls.each(function(md,i) { |
|
|
}); |
|
|
attr.classes[i] = md.get('name'); |
|
|
} |
|
|
}); |
|
|
if(cls.length){ |
|
|
|
|
|
cls.each(function(md,i) { |
|
|
|
|
|
attr.classes[i] = md.get('name'); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
attr.status = ''; |
|
|
attr.status = ''; |
|
|
attr.view = ''; |
|
|
attr.view = ''; |
|
|
|
|
|
|
|
|
|
|
|
if(reset){ |
|
|
|
|
|
this.opt.collection = null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return new this.constructor(attr, this.opt); |
|
|
return new this.constructor(attr, this.opt); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|