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';
export default {
methods: {
initAutoSave(noteable) {
this.autosave = new Autosave($(this.$refs.noteForm.$refs.textarea), [
initAutoSave(noteable, extraKeys = []) {
let keys = [
'Note',
capitalizeFirstCharacter(noteable.noteable_type),
capitalizeFirstCharacter(noteable.noteable_type || noteable.noteableType),
noteable.id,
]);
];
if (extraKeys) {
keys = keys.concat(extraKeys);
}
this.autosave = new Autosave($(this.$refs.noteForm.$refs.textarea), keys);
},
resetAutoSave() {
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