removing .bind mootools call (phase 1/2)

This commit is contained in:
Ezequiel Bergamaschi
2014-07-06 01:15:34 -03:00
parent 3655df6cb8
commit f2b0eb74ea
17 changed files with 126 additions and 120 deletions

View File

@@ -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);
});
}
});