Add unit tests for custom tabs and modal titles

This commit is contained in:
Andy Armstrong
2014-04-03 12:02:48 -04:00
parent 5ab159b079
commit b779b8a6fb
6 changed files with 111 additions and 43 deletions

View File

@@ -70,7 +70,14 @@ define(["jquery", "underscore", "gettext", "js/views/modals/base_modal",
},
getTitle: function() {
var displayName = this.xblockElement.find('.component-header').text().trim();
var displayName = this.xblockElement.find('.xblock-header .header-details').text().trim();
// If not found, try the old unit page style rendering
if (!displayName) {
displayName = this.xblockElement.find('.component-header').text().trim();
if (!displayName) {
displayName = gettext('Component');
}
}
return interpolate(gettext("Editing: %(title)s"), { title: displayName }, true);
},