--- a/src_js/iconolab-bundle/src/components/editor/ShapeFree.vue Fri Mar 17 14:53:01 2017 +0100
+++ b/src_js/iconolab-bundle/src/components/editor/ShapeFree.vue Fri Mar 17 15:33:38 2017 +0100
@@ -3,8 +3,8 @@
<defs>
<path v-bind:id="annotationHref" ref="path" v-bind:d="path" class="path"></path>
</defs>
- <g ref="g" filter="url(#shadow)">
- <use v-bind:xlink:href="annotationSelector" v-bind:stroke-width="strokeWidth * 2" class="stroke-bg" />
+ <g ref="g">
+ <use v-bind:xlink:href="annotationSelector" v-bind:stroke-width="strokeWidth * 2" class="stroke-bg" filter="url(#shadow)" />
<use v-bind:xlink:href="annotationSelector" v-bind:stroke-width="strokeWidth" class="stroke-fg" />
<circle ref="handlers"
v-for="(point, key) in points"
@@ -52,13 +52,15 @@
},
annotationSelector: function() {
return '#' + this.annotationHref;
- }
+ },
},
mounted() {
+ var g = new Snap(this.$refs.g);
if (this.originalPath) {
this.fromSVGPath(this.originalPath, false);
- var g = new Snap(this.$refs.g);
g.click(() => this.$emit('click'));
+ } else {
+ g.dblclick(() => this.closePath());
}
},
watch: {
@@ -147,6 +149,14 @@
return this.$parent.normalizePath(this.path) + ';FREE'
},
+ closePath: function() {
+ this.closed = true;
+ this.$nextTick(() => {
+ // FIXME Race condition with destroy
+ setTimeout(() => this.addTooltip(), 250);
+ });
+ },
+
addResizeHandler: function(handler) {
var self = this;
@@ -158,11 +168,7 @@
circle.click((e) => {
var key = parseInt(circle.attr('data-key'), 10);
if (key === 0 && this.points.length > 2) {
- this.closed = true;
- this.$nextTick(() => {
- // FIXME Race condition with destroy
- setTimeout(() => this.addTooltip(), 250);
- });
+ this.closePath();
}
});