Commit 8b34b26a authored by Fatih Acet's avatar Fatih Acet

Add extra key support to autosave mixin.

parent 5be711ab
...@@ -4,12 +4,18 @@ import { capitalizeFirstCharacter } from '../../lib/utils/text_utility'; ...@@ -4,12 +4,18 @@ import { capitalizeFirstCharacter } from '../../lib/utils/text_utility';
export default { export default {
methods: { methods: {
initAutoSave(noteable) { initAutoSave(noteable, extraKeys = []) {
this.autosave = new Autosave($(this.$refs.noteForm.$refs.textarea), [ let keys = [
'Note', 'Note',
capitalizeFirstCharacter(noteable.noteable_type), capitalizeFirstCharacter(noteable.noteable_type || noteable.noteableType),
noteable.id, noteable.id,
]); ];
if (extraKeys) {
keys = keys.concat(extraKeys);
}
this.autosave = new Autosave($(this.$refs.noteForm.$refs.textarea), keys);
}, },
resetAutoSave() { resetAutoSave() {
this.autosave.reset(); this.autosave.reset();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment