diff --git a/cms/static/js/views/modals/edit_xblock.js b/cms/static/js/views/modals/edit_xblock.js index d11681fd92..c583e12e41 100644 --- a/cms/static/js/views/modals/edit_xblock.js +++ b/cms/static/js/views/modals/edit_xblock.js @@ -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, diff --git a/cms/static/js/views/xblock_editor.js b/cms/static/js/views/xblock_editor.js index 88911b2510..2a173d661a 100644 --- a/cms/static/js/views/xblock_editor.js +++ b/cms/static/js/views/xblock_editor.js @@ -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.