Added note tags to main note edit display

This commit is contained in:
Max G 2020-03-09 03:11:05 +00:00
parent d3c0d6e2b9
commit 4c17efceea
2 changed files with 27 additions and 6 deletions

View File

@ -61,7 +61,6 @@
<!-- Toolbar on the bottom --> <!-- Toolbar on the bottom -->
<div class="tool-bar" @click.self="cardClicked"> <div class="tool-bar" @click.self="cardClicked">
<div class="icon-bar"> <div class="icon-bar">
<!-- {{$helpers.timeAgo(note.updated)}} --> <!-- {{$helpers.timeAgo(note.updated)}} -->
@ -79,10 +78,14 @@
<!-- :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }" --> <!-- :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }" -->
<span class="float-right" :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }"> <span class="float-right" :class="{ 'hover-hide':(!$store.getters.getIsUserOnMobile) }">
<!-- <span class="teeny-button" data-tooltip="Archive" data-inverted> <!-- <span class="teeny-button" data-tooltip="Archive" data-inverted>
<i class="archive icon"></i> <i class="archive icon"></i>
</span> --> </span> -->
<i class="teeny-button" data-tooltip="Tags" data-inverted v-on:click="toggleTags(true)">
<i class="tags icon"></i>
</i>
<i class="teeny-button" data-tooltip="Pin" data-inverted v-on:click="pinNote"> <i class="teeny-button" data-tooltip="Pin" data-inverted v-on:click="pinNote">
<i class="pin icon"></i> <i class="pin icon"></i>
</i> </i>
@ -90,9 +93,6 @@
<delete-button class="teeny-button" :note-id="note.id" /> <delete-button class="teeny-button" :note-id="note.id" />
</span> </span>
</div> </div>
<div v-if="getThumbs.length > 0"> <div v-if="getThumbs.length > 0">
@ -103,9 +103,18 @@
</div> </div>
<side-slide-menu v-if="showTagSlideMenu" v-on:close="toggleTags(false)">
<div class="ui basic segment">
<note-tag-edit :noteId="note.id" :key="'display-tags-for-note-'+note.id"/>
</div>
</side-slide-menu>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -117,6 +126,8 @@
props: [ 'onClick', 'data', 'currentlyOpen', 'textResults', 'attachmentResults', 'tagResults' ], props: [ 'onClick', 'data', 'currentlyOpen', 'textResults', 'attachmentResults', 'tagResults' ],
components: { components: {
'delete-button': require('@/components/NoteDeleteButtonComponent.vue').default, 'delete-button': require('@/components/NoteDeleteButtonComponent.vue').default,
'note-tag-edit': require('@/components/NoteTagEdit.vue').default,
'side-slide-menu': require('@/components/SideSlideMenuComponent.vue').default,
}, },
methods:{ methods:{
cardClicked(){ cardClicked(){
@ -149,6 +160,14 @@
.then(data => { .then(data => {
this.$bus.$emit('update_single_note', this.note.id) this.$bus.$emit('update_single_note', this.note.id)
}) })
},
toggleTags(state){
this.showTagSlideMenu = state
if(state == false){
this.$bus.$emit('update_single_note', this.note.id)
}
}, },
}, },
@ -160,6 +179,7 @@
noteIcon: null, noteIcon: null,
iconColor: null, iconColor: null,
beenClicked: false, beenClicked: false,
showTagSlideMenu: false,
} }
}, },
computed: { computed: {

View File

@ -213,6 +213,7 @@
this.$bus.$on('note_deleted', (noteId) => { this.$bus.$on('note_deleted', (noteId) => {
//Remove deleted note from set, its deleted //Remove deleted note from set, its deleted
this.fetchUserTags()
Object.keys(this.noteSections).forEach( key => { Object.keys(this.noteSections).forEach( key => {
this.noteSections[key].forEach( (note, index) => { this.noteSections[key].forEach( (note, index) => {
if(note.id == noteId){ if(note.id == noteId){