Commit 230c0b5b by Andy Armstrong

Add more improvements from the review.

parent b23f17db
......@@ -75,7 +75,10 @@ define(["jquery", "underscore", "js/views/baseview", "js/views/xblock", "js/view
refreshXBlock: function(xblockInfo, xblockElement) {
var self = this,
temporaryView;
// Create a temporary view to render the updated XBlock into
// There is only one Backbone view created on the container page, which is
// for the container xblock itself. Any child xblocks rendered inside the
// container do not get a Backbone view. Thus, create a temporary XBlock
// around the child element so that it can be refreshed.
temporaryView = new XBlockView({
el: xblockElement,
model: xblockInfo,
......
......@@ -106,14 +106,11 @@ define(["jquery", "underscore", "gettext", "js/views/feedback_notification", "js
getXBlockData: function() {
var xblock = this.xblock,
metadataEditor = this.getMetadataEditor(),
metadata,
data;
data = xblock.save();
metadata = data.metadata;
if (metadataEditor) {
metadata = _.extend(metadata || {}, this.getChangedMetadata());
data.metadata = _.extend(data.metadata || {}, this.getChangedMetadata());
}
data.metadata = metadata;
return data;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment