Bug fix for modal cover not going way when click outside of edit (#106).
This commit is contained in:
@@ -56,7 +56,7 @@ class CMS.Views.ModuleEdit extends Backbone.View
|
||||
event.preventDefault()
|
||||
data = @module.save()
|
||||
data.metadata = _.extend(data.metadata, @metadata())
|
||||
$modalCover.hide()
|
||||
@hideModal()
|
||||
@model.save(data).done( =>
|
||||
# # showToastMessage("Your changes have been saved.", null, 3)
|
||||
@module = null
|
||||
@@ -70,11 +70,15 @@ class CMS.Views.ModuleEdit extends Backbone.View
|
||||
event.preventDefault()
|
||||
@$el.removeClass('editing')
|
||||
@$component_editor().slideUp(150)
|
||||
@hideModal()
|
||||
|
||||
hideModal: ->
|
||||
$modalCover.hide()
|
||||
$modalCover.removeClass('is-fixed')
|
||||
|
||||
clickEditButton: (event) ->
|
||||
event.preventDefault()
|
||||
@$el.addClass('editing')
|
||||
$modalCover.show()
|
||||
$modalCover.show().addClass('is-fixed')
|
||||
@$component_editor().slideDown(150)
|
||||
@loadEdit()
|
||||
|
||||
@@ -29,9 +29,7 @@ $(document).ready(function() {
|
||||
$('.expand-collapse-icon').bind('click', toggleSubmodules);
|
||||
$('.visibility-options').bind('change', setVisibility);
|
||||
|
||||
$('.unit-history ol a').bind('click', showHistoryModal);
|
||||
$modal.bind('click', hideModal);
|
||||
$modalCover.bind('click', hideHistoryModal);
|
||||
$modalCover.bind('click', hideModal);
|
||||
$('.assets .upload-button').bind('click', showUploadModal);
|
||||
$('.upload-modal .close-button').bind('click', hideModal);
|
||||
@@ -498,9 +496,14 @@ function hideModal(e) {
|
||||
if(e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
$('.file-input').unbind('change', startUpload);
|
||||
$modal.hide();
|
||||
$modalCover.hide();
|
||||
// Unit editors do not want the modal cover to hide when users click outside
|
||||
// of the editor. Users must press Cancel or Save to exit the editor.
|
||||
// module_edit adds and removes the "is-fixed" class.
|
||||
if (!$modalCover.hasClass("is-fixed")) {
|
||||
$('.file-input').unbind('change', startUpload);
|
||||
$modal.hide();
|
||||
$modalCover.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onKeyUp(e) {
|
||||
@@ -530,21 +533,6 @@ function closeComponentEditor(e) {
|
||||
$(this).closest('.xmodule_edit').removeClass('editing').find('.component-editor').slideUp(150);
|
||||
}
|
||||
|
||||
|
||||
function showHistoryModal(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$modal.show();
|
||||
$modalCover.show();
|
||||
}
|
||||
|
||||
function hideHistoryModal(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$modal.hide();
|
||||
$modalCover.hide();
|
||||
}
|
||||
|
||||
function showDateSetter(e) {
|
||||
e.preventDefault();
|
||||
var $block = $(this).closest('.due-date-input');
|
||||
|
||||
Reference in New Issue
Block a user