diff -r 3b49e0484af2 -r ebec1d59dc74 src_js/iconolab-bundle/src/components/editor/Canvas.vue --- a/src_js/iconolab-bundle/src/components/editor/Canvas.vue Wed Feb 22 15:39:28 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/editor/Canvas.vue Wed Feb 22 15:41:07 2017 +0100 @@ -6,9 +6,13 @@ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + v-bind:paper="paper" + v-bind:original-annotation="annotation" + v-bind:readonly="readonly"> + v-bind:paper="paper" + v-bind:original-annotation="annotation" + v-bind:readonly="readonly">
@@ -31,10 +35,12 @@
- - @@ -55,15 +61,11 @@ thumbnail: String, annotation: { type: Object, - default: function () { - return null; - } + default: null }, tooltip: { type: Boolean, - default: function () { - return false; - } + default: false }, }, components: { @@ -83,6 +85,7 @@ imgMinSize: 0, imageWidth: 0, imageHeight: 0, + readonly: false } }, watch: { @@ -111,8 +114,10 @@ }, annotation: function(annotation) { this.reset(); - if (!this.annotation) { return; } - this.loadAnnotation(); + this.readonly = !!annotation; + if (this.annotation) { + this.loadAnnotation(); + } }, scale: function(scale) { var factor = 0; @@ -245,6 +250,12 @@ } }, + setMode: function(mode) { + if (this.readonly) { return; } + + this.mode = mode; + }, + getCenter: function() { return { x: this.viewBox[0] + (this.viewBox[2] / 2),