X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=ang%2FcrmUi.js;h=3f091914b2a88f6d874ba2faad6281b82b1b5ae0;hb=61968591fc2bd6eb866dbe2a8420d9559bc0d43d;hp=944630d4dbf8eb7a6c6b11b4b9508734243671ec;hpb=0335975be63dcecd805572e8a951203c1e28618a;p=civicrm-core.git diff --git a/ang/crmUi.js b/ang/crmUi.js index 944630d4db..3f091914b2 100644 --- a/ang/crmUi.js +++ b/ang/crmUi.js @@ -1083,15 +1083,20 @@ function update() { $timeout(function() { var newPageTitle = _.trim($el.html()), - newDocumentTitle = scope.crmDocumentTitle || $el.text(); + newDocumentTitle = scope.crmDocumentTitle || $el.text(), + h1Count = 0; document.title = $('title').text().replace(documentTitle, newDocumentTitle); // If the CMS has already added title markup to the page, use it $('h1').not('.crm-container h1').each(function() { - if (_.trim($(this).html()) === pageTitle) { + if ($(this).hasClass('crm-page-title') || _.trim($(this).html()) === pageTitle) { $(this).addClass('crm-page-title').html(newPageTitle); $el.hide(); + ++h1Count; } }); + if (!h1Count) { + $el.show(); + } pageTitle = newPageTitle; documentTitle = newDocumentTitle; });