src_js/iconolab-bundle/src/components/editor/ShapeRect.vue
changeset 323 55c024fc7c60
parent 320 81945eedc63f
child 332 1670e5e1ed97
--- a/src_js/iconolab-bundle/src/components/editor/ShapeRect.vue	Mon Feb 20 17:14:08 2017 +0100
+++ b/src_js/iconolab-bundle/src/components/editor/ShapeRect.vue	Mon Feb 20 17:29:55 2017 +0100
@@ -38,6 +38,7 @@
         props: [
             'paper',
             'original-annotation',
+            'tooltip'
         ],
         data() {
             return {
@@ -153,7 +154,7 @@
                 bottomRightHandler.drag(handlerEvents.onMove, handlerEvents.onStart, handlerEvents.onEnd);
             },
 
-            fromSVGPath: function(pathString, imageWidth, imageHeight) {
+            fromSVGPath: function(pathString, tooltip) {
                 var bBox = Snap.path.getBBox(pathString);
 
                 Object.assign(this, {
@@ -161,10 +162,13 @@
                     width: bBox.width, height: bBox.height
                 });
 
-                setTimeout(() => {
+                this.$nextTick(() => {
                     this.addResizeHandlers();
-                    this.addTooltip();
-                }, 50);
+                    if (tooltip) {
+                        // FIXME Race condition with destroy
+                        setTimeout(() => this.addTooltip(), 250);
+                    }
+                });
             },
 
             toSVGPath: function() {