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) { render_bbox(container, box) {
container.path(box.path) container.path(box.path)
.attr({ .addClass('bounding-box');
'class': 'bounding-box'
});
}, },
render() { render() {
this.container.attr({ 'class': 'placeholder' }); this.container.addClass('placeholder');
this.label = this.render_label(this.container, this.textValue); this.label = this.render_label(this.container, this.textValue);

View File

@ -11,7 +11,7 @@ export default _.extend({}, Base, {
if (this.anchor_start()) { if (this.anchor_start()) {
this.contents.anchor_start = this.render_label(this.container, 'Start of line') 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) { this.contents.parts = _.map(this.parts(), function(part) {
@ -22,7 +22,7 @@ export default _.extend({}, Base, {
if (this.anchor_end()) { if (this.anchor_end()) {
this.contents.anchor_end = this.render_label(this.container, 'End of line') 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)); .translate(10, 0));
this.regexp.render(); this.regexp.render();
this.start = this.container.circle().attr({ this.start = this.container.circle()
r: 5, .addClass('pin')
'class': 'pin' .attr({ r: 5 });
}); this.end = this.container.circle()
this.end = this.container.circle().attr({ .addClass('pin')
r: 5, .attr({ r: 5 });
'class': 'pin'
});
}, },
position() { position() {
@ -26,7 +24,7 @@ export default _.extend({}, Base, {
contentBox = this.regexp.container.getBBox(); contentBox = this.regexp.container.getBBox();
this.regexp.container.before( this.container.prepend(
this.container.path(Snap.format('M0,{cy}h10M{x2},{cy}h10', contentBox)) this.container.path(Snap.format('M0,{cy}h10M{x2},{cy}h10', contentBox))
); );