0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

update document title on blog title change

no issue
- force document.title to recompute when the blog title is changed in settings/general
This commit is contained in:
Austin Burdine 2016-05-15 18:41:28 -06:00
parent 7c786a6385
commit 2a9c916a58
2 changed files with 11 additions and 0 deletions

View file

@ -86,6 +86,10 @@ export default Controller.extend(SettingsSaveMixin, {
return this.get('model').save().then((model) => { return this.get('model').save().then((model) => {
config.set('blogTitle', model.get('title')); config.set('blogTitle', model.get('title'));
// this forces the document title to recompute after
// a blog title change
this.send('collectTitleTokens', []);
return model; return model;
}).catch((error) => { }).catch((error) => {
if (error) { if (error) {

View file

@ -89,6 +89,13 @@ describe('Acceptance: Settings - General', function () {
expect(find('input#permalinks').prop('checked'), 'date permalinks checkbox').to.be.false; expect(find('input#permalinks').prop('checked'), 'date permalinks checkbox').to.be.false;
}); });
fillIn('#settings-general input[name="general[title]"]', 'New Blog Title');
click('.view-header .btn.btn-blue');
andThen(() => {
expect(document.title, 'page title').to.equal('Settings - General - New Blog Title');
});
click('.blog-logo'); click('.blog-logo');
andThen(() => { andThen(() => {