|
|
|
|
@ -64,13 +64,13 @@ |
|
|
|
|
<div class="info__sidebar"> |
|
|
|
|
<div class="info__wrap"> |
|
|
|
|
<div class="info__fieldset"> |
|
|
|
|
<!--<div class="info__field field"> |
|
|
|
|
<div class="info__field field"> |
|
|
|
|
<div class="field__label field__label_gray">ССЫЛКА</div> |
|
|
|
|
<div class="field__wrap"> |
|
|
|
|
<input type="text" class="field__input" v-model="course.url"> |
|
|
|
|
</div> |
|
|
|
|
<div class="field__wrap field__wrap--additional">{{ courseFullUrl }}</div> |
|
|
|
|
</div>--> |
|
|
|
|
<div class="field__wrap field__wrap--additional">{{ courseFullUrl }}</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="info__field field"> |
|
|
|
|
<div class="field__label field__label_gray">ДОСТУП</div> |
|
|
|
|
<div class="field__wrap"> |
|
|
|
|
@ -135,7 +135,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="kit__nav"> |
|
|
|
|
<div id="course-redactor__nav" class="kit__nav"> |
|
|
|
|
<button class="kit__btn btn btn_lg" |
|
|
|
|
v-bind:class="{ 'btn_stroke': viewSection === 'course', 'btn_gray': viewSection !== 'course' }" |
|
|
|
|
type="button" @click="viewSection = 'course'">Описание |
|
|
|
|
@ -334,7 +334,8 @@ |
|
|
|
|
], |
|
|
|
|
showErrors: false, |
|
|
|
|
savingTimeout: null, |
|
|
|
|
categoryOptions: [] |
|
|
|
|
categoryOptions: [], |
|
|
|
|
courseSyncHook: false, // Если true, то watch не будет отправлять курс на обновление |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
validations: { |
|
|
|
|
@ -402,7 +403,7 @@ |
|
|
|
|
}, |
|
|
|
|
removeLesson(lessonIndex) { |
|
|
|
|
if (!confirm('Вы действительно хотите удалить этот урок?')) { |
|
|
|
|
return |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
const lesson = this.lessons[lessonIndex]; |
|
|
|
|
if (lesson.hasOwnProperty('id') && lesson.id) { |
|
|
|
|
@ -464,6 +465,10 @@ |
|
|
|
|
}, |
|
|
|
|
goToLessons() { |
|
|
|
|
this.viewSection = 'lessons'; |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
const elementTop = $('#course-redactor__nav').position().top - 130; |
|
|
|
|
$(window).scrollTop(elementTop); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
loadCourseDraft() { |
|
|
|
|
this.courseLoading = true; |
|
|
|
|
@ -528,7 +533,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 +639,9 @@ |
|
|
|
|
watch: { |
|
|
|
|
'course': { |
|
|
|
|
handler: function (newValue, oldValue) { |
|
|
|
|
if (this.courseSyncHook) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.saveCourseDraft(newValue, oldValue); |
|
|
|
|
}, |
|
|
|
|
deep: true, |
|
|
|
|
|