page title update fix

This commit is contained in:
Yuri Kuznetsov
2020-03-05 16:28:16 +02:00
parent 5e3f00f11d
commit d75bc354cf
+13 -1
View File
@@ -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);
},