Complete Studio support for handling group configuration changes

STUD-1658
This commit is contained in:
cahrens
2014-06-16 10:48:46 -04:00
committed by Andy Armstrong
parent 73e7ced6f9
commit a395c2fa4b
11 changed files with 239 additions and 149 deletions

View File

@@ -1,4 +1,5 @@
define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext", "js/views/feedback_notification"],
define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext", "js/views/feedback_notification",
"jquery.ui"], // The container view uses sortable, which is provided by jquery.ui.
function ($, _, XBlockView, ModuleUtils, gettext, NotificationView) {
var reorderableClass = '.reorderable-container',
sortableInitializedClass = '.ui-sortable',

View File

@@ -168,10 +168,6 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal",
if (this.runtime) {
this.runtime.notify('modal-hidden');
}
// Completely clear the contents of the modal
this.undelegateEvents();
this.$el.html("");
},
findXBlockInfo: function(xblockWrapperElement, defaultXBlockInfo) {

View File

@@ -28,8 +28,11 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/contai
// Hide both blocks until we know which one to show
xblockView.$el.addClass('is-hidden');
// Add actions to any top level buttons, e.g. "Edit" of the container itself
self.addButtonActions(this.$el);
if (!options || !options.refresh) {
// Add actions to any top level buttons, e.g. "Edit" of the container itself.
// Do not add the actions on "refresh" though, as the handlers are already registered.
self.addButtonActions(this.$el);
}
// Render the xblock
xblockView.render({
@@ -192,7 +195,7 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/contai
parentElement = xblockElement.parent(),
rootLocator = this.xblockView.model.id;
if (xblockElement.length === 0 || xblockElement.data('locator') === rootLocator) {
this.render({ });
this.render({refresh: true});
} else if (parentElement.hasClass('reorderable-container')) {
this.refreshChildXBlock(xblockElement);
} else {