++ If press DELETE or BACKSPACE and is blank description, delete the Todos.

- fix: if offline, doesn't save to cache??  if I refresh page, the data disappear
- ++ field to the percent progress
- fix: Refreshing 2 times the array todos.. because there is a filter
This commit is contained in:
Paolo Arena
2019-02-12 19:09:43 +01:00
parent a024b78e95
commit 259e2dc4e2
17 changed files with 252 additions and 188 deletions

View File

@@ -264,6 +264,15 @@ export default class SingleTodo extends Vue {
}
}
*/
if (((e.keyCode === 8) || (e.keyCode === 46)) && (this.precDescr === '') && !e.shiftKey) {
e.preventDefault()
this.clickMenu(rescodes.MenuAction.DELETE)
.then(() => {
this.deselectRiga()
this.faiFocus('insertTask', true)
return
})
}
if (((e.key === 'Enter') || (e.key === 'Tab')) && !e.shiftKey) {
this.updateTodo()
@@ -344,16 +353,16 @@ export default class SingleTodo extends Vue {
}
clickMenu(action) {
async clickMenu(action) {
console.log('click menu: ', action)
if (action === rescodes.MenuAction.DELETE) {
this.askConfirmDelete()
return this.askConfirmDelete()
} else if (action === rescodes.MenuAction.TOGGLE_EXPIRING) {
this.enableExpiring()
return this.enableExpiring()
} else if (action === rescodes.MenuAction.COMPLETED) {
this.setCompleted()
return this.setCompleted()
} else if (action === rescodes.MenuAction.PROGRESS_BAR) {
this.updatedata()
return this.updatedata()
}
}
@@ -369,11 +378,11 @@ export default class SingleTodo extends Vue {
// this.$q.notify('setPriority: ' + elem)
}
askConfirmDelete() {
async askConfirmDelete() {
const deletestr = this.$t('dialog.delete')
const cancelstr = this.$t('dialog.cancel')
askConfirm(this.$q, this.$t('dialog.msg.titledeleteTask'), this.$t('dialog.msg.deleteTask').toString(), deletestr, cancelstr)
await askConfirm(this.$q, this.$t('dialog.msg.titledeleteTask'), this.$t('dialog.msg.deleteTask').toString(), deletestr, cancelstr)
.then(ris => {
console.log('ris', ris)
if (ris)