Adding some styling to start and end anchors

This commit is contained in:
Jeff Avallone 2014-12-03 20:02:56 -05:00
parent a88c4821b7
commit d1a058768e
4 changed files with 21 additions and 9 deletions

View File

@ -34,12 +34,20 @@
stroke: #000; stroke: #000;
} }
circle.anchor { circle.pin {
fill: #6b6659; fill: #6b6659;
stroke-width: 2px; stroke-width: 2px;
stroke: #000; stroke: #000;
} }
.anchor text {
fill: #fff;
}
.anchor rect {
fill: #6b6659;
}
.placeholder text { .placeholder text {
fill: #fff; fill: #fff;
font-weight: bold; font-weight: bold;

View File

@ -2,10 +2,7 @@ export default {
render_label(container, text) { render_label(container, text) {
var group = container.group(); var group = container.group();
group.rect().attr({ group.rect();
rx: 10,
ry: 10
});
group.text().attr({ group.text().attr({
text: text text: text
@ -40,6 +37,11 @@ export default {
this.container.attr({ 'class': 'placeholder' }); this.container.attr({ 'class': 'placeholder' });
this.label = this.render_label(this.container, this.textValue); this.label = this.render_label(this.container, this.textValue);
this.label.select('rect').attr({
rx: 10,
ry: 10
});
}, },
position() { position() {

View File

@ -10,7 +10,8 @@ export default _.extend({}, Base, {
this.contents = {}; this.contents = {};
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' });
} }
this.contents.parts = _.map(this.parts(), function(part) { this.contents.parts = _.map(this.parts(), function(part) {
@ -20,7 +21,8 @@ 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' });
} }
}, },

View File

@ -10,11 +10,11 @@ export default _.extend({}, Base, {
this.start = this.container.circle().attr({ this.start = this.container.circle().attr({
r: 5, r: 5,
'class': 'anchor' 'class': 'pin'
}); });
this.end = this.container.circle().attr({ this.end = this.container.circle().attr({
r: 5, r: 5,
'class': 'anchor' 'class': 'pin'
}); });
}, },