Clean up the logic for the edit modal's title
This commit is contained in:
@@ -53,10 +53,7 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal",
|
||||
|
||||
onDisplayXBlock: function() {
|
||||
var editorView = this.editorView,
|
||||
displayName,
|
||||
title;
|
||||
displayName = editorView.getDisplayName();
|
||||
title = interpolate(gettext("Editing: %(title)s"), { title: displayName }, true);
|
||||
title = this.getTitle();
|
||||
if (editorView.hasCustomTabs()) {
|
||||
// Hide the modal's header as the custom editor provides its own
|
||||
this.$('.modal-header').hide();
|
||||
@@ -72,6 +69,11 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal",
|
||||
}
|
||||
},
|
||||
|
||||
getTitle: function() {
|
||||
var displayName = this.xblockElement.find('.component-header').text().trim();
|
||||
return interpolate(gettext("Editing: %(title)s"), { title: displayName }, true);
|
||||
},
|
||||
|
||||
addDefaultModes: function() {
|
||||
var defaultModes = this.editorView.getDefaultModes(),
|
||||
i,
|
||||
|
||||
@@ -117,14 +117,6 @@ define(["jquery", "underscore", "gettext", "js/views/feedback_notification", "js
|
||||
return data;
|
||||
},
|
||||
|
||||
getDisplayName: function() {
|
||||
var metadataEditor = this.getMetadataEditor();
|
||||
if (metadataEditor) {
|
||||
return metadataEditor.getDisplayName();
|
||||
}
|
||||
return "How do we get the display name now?";
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the metadata that has changed in the editor. This is a combination of the metadata
|
||||
* modified in the "Settings" editor, as well as any custom metadata provided by the component.
|
||||
|
||||
Reference in New Issue
Block a user