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;
}
circle.anchor {
circle.pin {
fill: #6b6659;
stroke-width: 2px;
stroke: #000;
}
.anchor text {
fill: #fff;
}
.anchor rect {
fill: #6b6659;
}
.placeholder text {
fill: #fff;
font-weight: bold;

View File

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

View File

@ -10,7 +10,8 @@ export default _.extend({}, Base, {
this.contents = {};
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) {
@ -20,7 +21,8 @@ export default _.extend({}, Base, {
});
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({
r: 5,
'class': 'anchor'
'class': 'pin'
});
this.end = this.container.circle().attr({
r: 5,
'class': 'anchor'
'class': 'pin'
});
},