Мелкие правки

remotes/origin/hasaccess
Vitaly Baev 8 years ago
parent 465a927b96
commit 9605f88a09
  1. 10
      web/src/components/CourseRedactor.vue

@ -334,6 +334,7 @@
], ],
showErrors: false, showErrors: false,
savingTimeout: null, savingTimeout: null,
savingDebounceTimeout: null,
categoryOptions: [], categoryOptions: [],
courseSyncHook: false, // Если true, то watch не будет отправлять курс на обновление courseSyncHook: false, // Если true, то watch не будет отправлять курс на обновление
} }
@ -519,10 +520,14 @@
let newTab = window.open(`/course/${this.course.id}`, '_blank'); let newTab = window.open(`/course/${this.course.id}`, '_blank');
newTab.focus(); newTab.focus();
}, },
saveCourseDraft: debounce(function (newValue, oldValue) { saveCourseDraft: function (newValue, oldValue) {
if (!oldValue.id) { if (!oldValue.id) {
return; return;
} }
if (this.savingDebounceTimeout) {
clearTimeout(this.savingDebounceTimeout);
}
this.savingDebounceTimeout = setTimeout(() => {
this.courseSaving = true; this.courseSaving = true;
clearTimeout(this.savingTimeout); clearTimeout(this.savingTimeout);
document.getElementById('course-redactor__saving-status').innerText = 'СОХРАНЕНИЕ'; document.getElementById('course-redactor__saving-status').innerText = 'СОХРАНЕНИЕ';
@ -542,7 +547,8 @@
.catch((err) => { .catch((err) => {
this.courseSaving = false; this.courseSaving = false;
}); });
}, 2000) }, 2000);
}
}, },
mounted() { mounted() {
api.getCategories(this.accessToken) api.getCategories(this.accessToken)

Loading…
Cancel
Save