Some cleanup

This commit is contained in:
Jeff Avallone 2014-12-03 20:20:08 -05:00
parent e7e97b0008
commit 502e4494d9
3 changed files with 11 additions and 15 deletions

View File

@ -28,13 +28,11 @@ export default {
render_bbox(container, box) {
container.path(box.path)
.attr({
'class': 'bounding-box'
});
.addClass('bounding-box');
},
render() {
this.container.attr({ 'class': 'placeholder' });
this.container.addClass('placeholder');
this.label = this.render_label(this.container, this.textValue);

View File

@ -11,7 +11,7 @@ export default _.extend({}, Base, {
if (this.anchor_start()) {
this.contents.anchor_start = this.render_label(this.container, 'Start of line')
.attr({ 'class': 'anchor' });
.addClass('anchor');
}
this.contents.parts = _.map(this.parts(), function(part) {
@ -22,7 +22,7 @@ export default _.extend({}, Base, {
if (this.anchor_end()) {
this.contents.anchor_end = this.render_label(this.container, 'End of line')
.attr({ 'class': 'anchor' });
.addClass('anchor');
}
},

View File

@ -9,14 +9,12 @@ export default _.extend({}, Base, {
.translate(10, 0));
this.regexp.render();
this.start = this.container.circle().attr({
r: 5,
'class': 'pin'
});
this.end = this.container.circle().attr({
r: 5,
'class': 'pin'
});
this.start = this.container.circle()
.addClass('pin')
.attr({ r: 5 });
this.end = this.container.circle()
.addClass('pin')
.attr({ r: 5 });
},
position() {
@ -26,7 +24,7 @@ export default _.extend({}, Base, {
contentBox = this.regexp.container.getBBox();
this.regexp.container.before(
this.container.prepend(
this.container.path(Snap.format('M0,{cy}h10M{x2},{cy}h10', contentBox))
);