From d75bc354cf8d2df469e25623bb24ec4e47696c7e Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 5 Mar 2020 16:28:16 +0200 Subject: [PATCH] page title update fix --- client/src/views/detail.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/client/src/views/detail.js b/client/src/views/detail.js index ab32242e20..68338ab697 100644 --- a/client/src/views/detail.js +++ b/client/src/views/detail.js @@ -74,6 +74,8 @@ define('views/detail', 'views/main', function (Dep) { this.setupHeader(); this.setupRecord(); + this.setupPageTitle(); + if (this.getMetadata().get('scopes.' + this.scope + '.stream')) { if (this.model.has('isFollowed')) { this.handleFollowButton(); @@ -85,6 +87,17 @@ define('views/detail', 'views/main', function (Dep) { } }, + setupPageTitle: function () { + this.listenTo(this.model, 'after:save', function () { + this.updatePageTitle(); + }, this); + this.listenTo(this.model, 'sync', function (model) { + if (model && model.hasChanged('name')) { + this.updatePageTitle(); + } + }, this); + }, + setupHeader: function () { this.createView('header', this.headerView, { model: this.model, @@ -98,7 +111,6 @@ define('views/detail', 'views/main', function (Dep) { if (this.getView('header')) { this.getView('header').reRender(); } - this.updatePageTitle(); } }, this); },