# HG changeset patch # User Alexandre Segura # Date 1487774467 -3600 # Node ID ebec1d59dc74043501c7bd052d122be457b0235d # Parent 3b49e0484af251df460c00c184a22dc6b38a610f Disable resize & change drawing mode when readonly. 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), diff -r 3b49e0484af2 -r ebec1d59dc74 src_js/iconolab-bundle/src/components/editor/ShapeFree.vue --- a/src_js/iconolab-bundle/src/components/editor/ShapeFree.vue Wed Feb 22 15:39:28 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/editor/ShapeFree.vue Wed Feb 22 15:41:07 2017 +0100 @@ -3,17 +3,15 @@ - @@ -29,6 +27,7 @@ props: [ 'paper', 'original-annotation', + 'readonly', ], data() { return { @@ -190,12 +189,9 @@