Hide bookmark actions in edit mode

This commit is contained in:
Christian Cueni 2019-11-04 16:29:30 +01:00
parent 9b1c54cad2
commit 2d39ee8775
1 changed files with 7 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="content-component" :class="{'content-component--bookmarked': bookmarked}">
<bookmark-actions
v-if="component.type !== 'content_list' && component.type !== 'basic_knowledge'"
v-if="showBookmarkActions()"
@add-note="addNote(component.id)"
@edit-note="editNote"
@bookmark="bookmarkContent(component.id, !bookmarked)"
@ -17,6 +17,8 @@
</template>
<script>
import {mapGetters} from 'vuex';
import TextBlock from '@/components/content-blocks/TextBlock';
import InstrumentWidget from '@/components/content-blocks/InstrumentWidget';
import ImageBlock from '@/components/content-blocks/ImageBlock';
@ -61,6 +63,7 @@
},
computed: {
...mapGetters(['editModule']),
bookmarked() {
return this.bookmarks && !!this.bookmarks.find(bookmark => bookmark.uuid === this.component.id);
},
@ -132,6 +135,9 @@
}
});
},
showBookmarkActions() {
return this.component.type !== 'content_list' && this.component.type !== 'basic_knowledge' && !this.editModule;
}
}
};
</script>