Removing unnecessary binds

This commit is contained in:
Jeff Avallone
2014-12-15 22:00:24 -05:00
parent d22ab35b68
commit 84d3fe797d
7 changed files with 27 additions and 28 deletions
+7 -8
View File
@@ -60,10 +60,10 @@ export default class Regexper {
this.setState('is-loading');
this.renderRegexp(expression.replace(/[\r\n]/g, ''))
.then((() => {
.then(() => {
this.setState('has-results');
this.updateLinks();
}).bind(this))
})
.done();
}
}
@@ -119,8 +119,7 @@ export default class Regexper {
}
renderRegexp(expression) {
var snap = Snap(this.svg),
padding = this.padding;
var snap = Snap(this.svg);
snap.selectAll('g').remove();
@@ -129,15 +128,15 @@ export default class Regexper {
return Q.fcall(parser.parse.bind(parser), expression)
.then(null, this.showError.bind(this))
.invoke('render', snap.group())
.then((result) => {
.then(result => {
var box;
box = result.getBBox();
result.container.transform(Snap.matrix()
.translate(padding - box.x, padding - box.y));
.translate(this.padding - box.x, this.padding - box.y));
snap.attr({
width: box.width + padding * 2,
height: box.height + padding * 2
width: box.width + this.padding * 2,
height: box.height + this.padding * 2
});
});
}