removing .bind mootools call (phase 1/2)
This commit is contained in:
@@ -32,9 +32,10 @@ mindplot.persistence.Beta2PelaMigrator = new Class({
|
||||
|
||||
// Beta does not set position on second level nodes ...
|
||||
var branches = mindmap.getBranches();
|
||||
var me = this;
|
||||
_.each(branches, function (model) {
|
||||
this._fixPosition(model);
|
||||
}.bind(this));
|
||||
me._fixPosition(model);
|
||||
});
|
||||
|
||||
return mindmap;
|
||||
},
|
||||
@@ -42,11 +43,12 @@ mindplot.persistence.Beta2PelaMigrator = new Class({
|
||||
_fixPosition:function (parentModel) {
|
||||
var parentPos = parentModel.getPosition();
|
||||
var isRight = parentPos.x > 0;
|
||||
var me = this;
|
||||
_.each(parentModel.getChildren(), function (child) {
|
||||
if (!child.getPosition()) {
|
||||
child.setPosition(parentPos.x + (50 * isRight ? 1 : -1), parentPos.y);
|
||||
}
|
||||
this._fixPosition(child);
|
||||
}.bind(this));
|
||||
me._fixPosition(child);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user