Browse Source

Fix #25 a regression introduced by traits

pull/36/head
Artur Arseniev 10 years ago
parent
commit
e3f339fb9a
  1. 5
      src/code_manager/model/JsonGenerator.js
  2. 4
      src/demo.js
  3. 12
      src/trait_manager/model/Trait.js

5
src/code_manager/model/JsonGenerator.js

@ -6,12 +6,10 @@ define(['backbone'],
return Backbone.Model.extend({
/** @inheritdoc */
build: function(model)
{
build: function(model) {
var json = model.toJSON();
this.beforeEach(json);
// Avoid jshint 'loopfunc' error
_.each(json,function(v, attr){
var obj = json[attr];
if(obj instanceof Backbone.Model){
@ -25,7 +23,6 @@ define(['backbone'],
}, this);
}
}
}, this);
return json;

4
src/demo.js

@ -30,7 +30,9 @@ require(['config/require-config'], function() {
content: 'mylink',
}],
*/
storageManager:{ autoload: 0},
storageManager:{
autoload: 0,
},
commands: {
defaults : [{
id: 'open-github',

12
src/trait_manager/model/Trait.js

@ -19,5 +19,17 @@ define(['backbone'],
throw new Error('Target not found');
},
/**
* Need to remove target from it otherwise with toJSON
* creates an infinite loop
* @return {Object}
* @private
*/
toJSON: function(){
var obj = this.attributes;
delete obj.target;
return obj;
}
});
});

Loading…
Cancel
Save