src_js/iconolab-bundle/src/components/editor/Canvas.vue
changeset 350 7c0b98b10e00
parent 345 4bf0f6ff748d
child 352 4f0ede751fcf
--- a/src_js/iconolab-bundle/src/components/editor/Canvas.vue	Wed Feb 22 18:31:01 2017 +0100
+++ b/src_js/iconolab-bundle/src/components/editor/Canvas.vue	Wed Feb 22 18:31:58 2017 +0100
@@ -2,7 +2,8 @@
     <div class="zoom">
         <div>
             <svg ref="svg"
-                v-bind:class="{ 'cut-canvas': true, 'canvas--rect': mode === 'rect', 'canvas--free': mode === 'free' }"
+                class="cut-canvas"
+                v-bind:class="canvasClass"
                 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
                 <image xmlns:xlink="http://www.w3.org/1999/xlink"
                     ref="image"
@@ -94,6 +95,14 @@
                 readonly: false
             }
         },
+        computed: {
+            canvasClass: function() {
+                return {
+                    'canvas--rect': !this.readonly && this.mode === 'rect',
+                    'canvas--free': !this.readonly && this.mode === 'free'
+                }
+            }
+        },
         watch: {
             mode: function(mode) {
                 this.reset();