meal plan hotkeys and sharing

This commit is contained in:
Kaibu
2021-11-25 01:28:07 +01:00
parent 19f5684d26
commit d76fdd090a
4 changed files with 52 additions and 6 deletions

View File

@@ -513,11 +513,17 @@ export default {
return entry.id === id
})[0]
},
moveEntry(null_object, target_date) {
moveEntry(null_object, target_date, drag_event) {
this.plan_entries.forEach((entry) => {
if (entry.id === this.dragged_item.id) {
entry.date = target_date
this.saveEntry(entry)
if (drag_event.ctrlKey) {
let new_entry = Object.assign({}, entry)
new_entry.date = target_date
this.createEntry(new_entry)
} else {
entry.date = target_date
this.saveEntry(entry)
}
}
})
},