1
0
mirror of https://github.com/flarum/core.git synced 2025-07-23 01:31:40 +02:00

Add index page title, add mechanism to clear title from defaultRoute. (#2047)

* Add "All Descriptions title to index

* Added system to clear custom title if we're on the default route
This commit is contained in:
Alexander Skvortsov
2020-06-27 14:18:49 -04:00
committed by GitHub
parent d6de442b8a
commit 2f9beccf2a
5 changed files with 22 additions and 6 deletions

View File

@@ -237,7 +237,10 @@ export default class Application {
}
updateTitle() {
document.title = (this.titleCount ? `(${this.titleCount}) ` : '') + (this.title ? this.title + ' - ' : '') + this.forum.attribute('title');
const count = this.titleCount ? `(${this.titleCount}) ` : '';
const pageTitleWithSeparator = this.title && m.route() !== '/' ? this.title + ' - ' : '';
const title = this.forum.attribute('title');
document.title = count + pageTitleWithSeparator + title;
}
/**

View File

@@ -79,7 +79,7 @@ export default class IndexPage extends Page {
extend(context, 'onunload', () => $('#app').css('min-height', ''));
app.setTitle('');
app.setTitle(app.translator.trans('core.forum.index.meta_title_text'));
app.setTitleCount(0);
// Work out the difference between the height of this hero and that of the