|
|
|
|
@ -334,7 +334,8 @@ |
|
|
|
|
], |
|
|
|
|
showErrors: false, |
|
|
|
|
savingTimeout: null, |
|
|
|
|
categoryOptions: [] |
|
|
|
|
categoryOptions: [], |
|
|
|
|
courseSyncHook: false, // Если true, то watch не будет отправлять курс на обновление |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
validations: { |
|
|
|
|
@ -528,7 +529,11 @@ |
|
|
|
|
this.savingTimeout = setTimeout(() => { |
|
|
|
|
document.getElementById('course-redactor__saving-status').innerText = ''; |
|
|
|
|
}, 2000); |
|
|
|
|
// this.course = api.convertCourseJson(response.data); |
|
|
|
|
this.courseSyncHook = true; |
|
|
|
|
this.course = api.convertCourseJson(response.data); |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.courseSyncHook = false; |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
.catch((err) => { |
|
|
|
|
this.courseSaving = false; |
|
|
|
|
@ -630,6 +635,9 @@ |
|
|
|
|
watch: { |
|
|
|
|
'course': { |
|
|
|
|
handler: function (newValue, oldValue) { |
|
|
|
|
if (this.courseSyncHook) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.saveCourseDraft(newValue, oldValue); |
|
|
|
|
}, |
|
|
|
|
deep: true, |
|
|
|
|
|