Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Giehl <stefan@piwik.org>2018-11-13 07:20:53 +0300
committerMatthieu Aubry <mattab@users.noreply.github.com>2018-11-13 07:20:53 +0300
commit50040d5874cd7831f1a90e9e52f8861a444e0d30 (patch)
treeaaa2bf78e8f8a4b16b3350fd2d2bf19272a60fe9 /plugins
parent8c86c0fc1047b3e11f35099e234870d57ca91754 (diff)
Update date in page title correctly (#13697)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/CoreHome/angularjs/common/services/piwik.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/CoreHome/angularjs/common/services/piwik.js b/plugins/CoreHome/angularjs/common/services/piwik.js
index 29596d39a2..3f6c2682bd 100644
--- a/plugins/CoreHome/angularjs/common/services/piwik.js
+++ b/plugins/CoreHome/angularjs/common/services/piwik.js
@@ -68,10 +68,11 @@
// Cache server-rendered page title
originalTitle = originalTitle || document.title;
- var titleParts = originalTitle.split('-');
- var dateString = ' ' + piwikPeriods.parse(period, date).getPrettyString() + ' ';
- titleParts.splice(1, 0, dateString);
- document.title = titleParts.join('-');
+
+ if (0 === originalTitle.indexOf(piwik.siteName)) {
+ var dateString = ' - ' + piwikPeriods.parse(period, date).getPrettyString() + ' ';
+ document.title = piwik.siteName + dateString + originalTitle.substr(piwik.siteName.length);
+ }
}
}