--- a/src_js/iconolab-bundle/src/components/editor/AnnotationForm.vue Mon Feb 20 17:46:45 2017 +0100
+++ b/src_js/iconolab-bundle/src/components/editor/AnnotationForm.vue Mon Feb 20 18:33:36 2017 +0100
@@ -30,7 +30,7 @@
import TagList from '../tagform/TagList.vue'
export default {
- props: ['action'],
+ props: ['action', 'annotation'],
components: {
'tag-list': TagList
},
@@ -40,7 +40,15 @@
'description': '',
'fragment': '',
'tags': [],
- 'annotation': null,
+ }
+ },
+ watch: {
+ annotation: function(annotation) {
+ if (annotation) {
+ Object.assign(this, annotation);
+ } else {
+ this.reset();
+ }
}
},
computed: {
@@ -63,12 +71,6 @@
}
},
methods: {
- setAnnotation: function(annotation) {
- const clone = annotation;
- this.annotation = clone;
-
- Object.assign(this, annotation);
- },
onTagsChange: function(tags) {
this.tags = tags;
},
@@ -76,8 +78,8 @@
Object.assign(this, {
'title': '',
'description': '',
- 'tags': [],
- 'annotation': null
+ 'fragment': '',
+ 'tags': []
});
},
hasChanged: function() {