Some cleanup
This commit is contained in:
parent
e7e97b0008
commit
502e4494d9
@ -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);
|
||||||
|
|
||||||
|
@ -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');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -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))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user