diff --git a/cms/static/js/spec/views/modals/edit_xblock_spec.js b/cms/static/js/spec/views/modals/edit_xblock_spec.js index e5331e30e4..06b4413784 100644 --- a/cms/static/js/spec/views/modals/edit_xblock_spec.js +++ b/cms/static/js/spec/views/modals/edit_xblock_spec.js @@ -61,7 +61,7 @@ describe('EditXBlockModal', function() { it('shows the correct title', function() { var requests = AjaxHelpers.requests(this); modal = showModal(requests, mockXBlockEditorHtml); - expect(modal.$('.modal-window-title span.modal-button-title').text()).toBe('Editing: Component'); + expect(modal.$('.modal-window-title').text()).toBe('Editing: Component'); }); it('does not show any editor mode buttons', function() { diff --git a/cms/static/js/spec_helpers/modal_helpers.js b/cms/static/js/spec_helpers/modal_helpers.js index 89b9b6b066..3b6c154cb3 100644 --- a/cms/static/js/spec_helpers/modal_helpers.js +++ b/cms/static/js/spec_helpers/modal_helpers.js @@ -29,7 +29,7 @@ define(['jquery', 'common/js/spec_helpers/template_helpers', 'common/js/spec_hel getModalTitle = function(modal) { var modalElement = getModalElement(modal); - return modalElement.find('.modal-window-title span.modal-button-title').text(); + return modalElement.find('.modal-window-title').text(); }; isShowingModal = function(modal) { diff --git a/cms/static/js/views/modals/edit_xblock.js b/cms/static/js/views/modals/edit_xblock.js index 661a3c090c..8a86b11fb1 100644 --- a/cms/static/js/views/modals/edit_xblock.js +++ b/cms/static/js/views/modals/edit_xblock.js @@ -90,16 +90,16 @@ define(['jquery', 'underscore', 'backbone', 'gettext', 'js/views/modals/base_mod // Update the custom editor's title editorView.$('.component-name').text(title); - } else { + } else if (editorView.getDataEditor() && editorView.getMetadataEditor()) { this.createTitleEditor(title); - if (editorView.getDataEditor() && editorView.getMetadataEditor()) { - this.addDefaultModes(); - // If the plugins content element exists, add a button to reveal it. - if (this.$('.wrapper-comp-plugins').length > 0) { - this.addModeButton('plugins', gettext('Plugins')); - } - this.selectMode(editorView.mode); + this.addDefaultModes(); + // If the plugins content element exists, add a button to reveal it. + if (this.$('.wrapper-comp-plugins').length > 0) { + this.addModeButton('plugins', gettext('Plugins')); } + this.selectMode(editorView.mode); + } else { + this.$('.modal-window-title').text(title); } // If the xblock is not using custom buttons then choose which buttons to show diff --git a/cms/static/js/views/pages/container.js b/cms/static/js/views/pages/container.js index fd4a05d10f..f86f3b2a37 100644 --- a/cms/static/js/views/pages/container.js +++ b/cms/static/js/views/pages/container.js @@ -198,7 +198,7 @@ define(['jquery', 'underscore', 'backbone', 'gettext', 'js/views/pages/base_page this.editXBlock(event, { view: 'visibility_view', // Translators: "title" is the name of the current component or unit being edited. - titleFormat: gettext('Editing access for: %(title)s'), + titleFormat: gettext('Editing access for: {title}'), viewSpecificClasses: '', modalSize: 'med' });