From 7e8899398c1e798d8da8aff05f6b86b72758a9bd Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 20 Jul 2017 09:58:36 -0400 Subject: [PATCH] CRM-20929 - Convey css classes to main page title from Angular --- ang/crmUi.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ang/crmUi.js b/ang/crmUi.js index d3ea3a469c..985edc291c 100644 --- a/ang/crmUi.js +++ b/ang/crmUi.js @@ -1002,16 +1002,22 @@ scope: { crmDocumentTitle: '=' }, + limit: 'ae', link: function(scope, $el, attrs) { function update() { $timeout(function() { var newPageTitle = _.trim($el.html()), - newDocumentTitle = scope.crmDocumentTitle || $el.text(); + newDocumentTitle = scope.crmDocumentTitle || $el.text(), + cls = $el.attr('class').split(' '), + classes = _.filter(cls, function(c) { + return c.indexOf('ng-') !== 0; + }); + classes.push('crm-page-title'); 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) { - $(this).html(newPageTitle); + $(this).addClass(classes.join(' ')).html(newPageTitle); $el.hide(); } }); -- 2.25.1