Merge pull request #14294 from edx/asadazam/tnl-6046-empty-handouts

Fixed Course handouts rejects deletion of all text
This commit is contained in:
AsadAzam
2017-01-13 15:06:12 +05:00
committed by GitHub
2 changed files with 19 additions and 1 deletions

View File

@@ -50,10 +50,14 @@ define(['js/views/baseview', 'codemirror', 'common/js/components/views/feedback_
},
onSave: function(event) {
var handoutsContent = this.$codeMirror.getValue();
$('#handout_error').removeClass('is-shown');
$('.save-button').removeClass('is-disabled').attr('aria-disabled', false);
if ($('.CodeMirror-lines').find('.cm-error').length == 0) {
this.model.set('data', this.$codeMirror.getValue());
if (handoutsContent === '') {
handoutsContent = '<ol></ol>';
}
this.model.set('data', handoutsContent);
var saving = new NotificationView.Mini({
title: gettext('Saving')
});