From a3312e0d05198b7a926af5da1128ac1735664a72 Mon Sep 17 00:00:00 2001 From: Paolo Arena Date: Wed, 30 Jan 2019 02:01:04 +0100 Subject: [PATCH] - Created component SubMenus to permit to call menu with: - right click - click on btn: --- src/components/todos/SingleTodo/SingleTodo.ts | 11 ++- .../todos/SingleTodo/SingleTodo.vue | 67 +++---------------- src/components/todos/SubMenus/SubMenus.ts | 16 ++++- src/components/todos/SubMenus/SubMenus.vue | 17 +++-- 4 files changed, 37 insertions(+), 74 deletions(-) diff --git a/src/components/todos/SingleTodo/SingleTodo.ts b/src/components/todos/SingleTodo/SingleTodo.ts index 63bbee3..436ac1c 100644 --- a/src/components/todos/SingleTodo/SingleTodo.ts +++ b/src/components/todos/SingleTodo/SingleTodo.ts @@ -38,6 +38,7 @@ export default class SingleTodo extends Vue { public percProgress: string = 'percProgress' public colProgress: string = 'blue' public togglemenu: boolean = false + public percentageProgress: number = 0 $q: any @Prop({ required: true }) itemtodo: ITodo @@ -92,10 +93,13 @@ export default class SingleTodo extends Vue { this.classExpiring = 'flex-item data-item' this.classExpiringEx = '' if (this.itemtodo.completed) { + this.percentageProgress = 100 this.classCompleted += ' icon_completed' this.classDescr += ' status_completed' this.classExpiring += ' status_completed' this.classExpiringEx += ' status_completed' + } else { + this.percentageProgress = this.itemtodo.progress } this.menuProgress = 'menuProgress' @@ -332,13 +336,6 @@ export default class SingleTodo extends Vue { // this.$q.notify('setPriority: ' + elem) } - getPercentageProgress() { - if (this.itemtodo.completed) - return 100 - else - return this.itemtodo.progress - } - askConfirmDelete() { const deletestr = this.$t('dialog.delete') const cancelstr = this.$t('dialog.cancel') diff --git a/src/components/todos/SingleTodo/SingleTodo.vue b/src/components/todos/SingleTodo/SingleTodo.vue index 16a3048..bbc070f 100644 --- a/src/components/todos/SingleTodo/SingleTodo.vue +++ b/src/components/todos/SingleTodo/SingleTodo.vue @@ -1,65 +1,16 @@