|
|
|
|
@ -251,6 +251,7 @@ |
|
|
|
|
import {api} from "../js/modules/api"; |
|
|
|
|
import BlockAdd from "./blocks/BlockAdd"; |
|
|
|
|
import debounce from 'lodash.debounce'; |
|
|
|
|
import $ from 'jquery'; |
|
|
|
|
import {required, minValue, numeric } from 'vuelidate/lib/validators' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
@ -492,6 +493,15 @@ |
|
|
|
|
}, |
|
|
|
|
onCoursePublish() { |
|
|
|
|
console.log('publish course'); |
|
|
|
|
const publishButton = $('#course-redactor__publish-button'); |
|
|
|
|
publishButton.attr('disabled', 'disabled'); |
|
|
|
|
api.publishCourse(this.course.id, this.accessToken) |
|
|
|
|
.then((response) => { |
|
|
|
|
document.getElementById('course-redactor__saving-status').innerText = 'НА МОДЕРАЦИИ'; |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
publishButton.removeAttr('disabled'); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
saveCourseDraft: debounce(function (newValue, oldValue) { |
|
|
|
|
if (!oldValue.id) { |
|
|
|
|
|