Skip to content

Commit 3e1a992

Browse files
committed
Add filter to page title
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 313a606 commit 3e1a992

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

js/script.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ $(function(){
2222

2323
OCA.Activity.Filter = {
2424
filter: undefined,
25+
defaultPageTitle: undefined,
2526
$navigation: $('#app-navigation'),
2627

2728

@@ -38,6 +39,10 @@ $(function(){
3839
return;
3940
}
4041

42+
if (!this.defaultPageTitle) {
43+
this.defaultPageTitle = window.document.title
44+
}
45+
4146
this.$navigation.find('a[data-navigation=' + this.filter + ']').parent().removeClass('active').removeAttr('aria-current');
4247
OCA.Activity.InfinitScrolling.firstKnownId = 0;
4348
OCA.Activity.InfinitScrolling.lastGivenId = 0;
@@ -51,7 +56,9 @@ $(function(){
5156
$('#loading_activities').removeClass('hidden');
5257
OCA.Activity.InfinitScrolling.ignoreScroll = 0;
5358

54-
this.$navigation.find('a[data-navigation=' + filter + ']').parent().addClass('active').attr('aria-current', 'page');
59+
var navigationLink = this.$navigation.find('a[data-navigation=' + filter + ']');
60+
navigationLink.parent().addClass('active').attr('aria-current', 'page');
61+
window.document.title = navigationLink.text().trim() + ' - ' + this.defaultPageTitle;
5562

5663
OCA.Activity.InfinitScrolling.prefill();
5764
}

0 commit comments

Comments
 (0)