Fix bug for desktop

This commit is contained in:
Julia Radzhabova 2019-09-18 11:08:01 +03:00
parent 614109a26f
commit 3cc0e9b5bd
3 changed files with 23 additions and 22 deletions

View file

@ -1600,7 +1600,7 @@ define([
if (this._state.isDocModified !== isModified || force) { if (this._state.isDocModified !== isModified || force) {
var title = this.defaultTitleText; var title = this.defaultTitleText;
if (!_.isEmpty(appHeader.getDocumentCaption())) if (appHeader && !_.isEmpty(appHeader.getDocumentCaption()))
title = appHeader.getDocumentCaption() + ' - ' + title; title = appHeader.getDocumentCaption() + ' - ' + title;
if (isModified) { if (isModified) {

View file

@ -1311,7 +1311,7 @@ define([
if (this._state.isDocModified !== isModified || force) { if (this._state.isDocModified !== isModified || force) {
var title = this.defaultTitleText; var title = this.defaultTitleText;
if (!_.isEmpty(appHeader.getDocumentCaption())) if (appHeader && !_.isEmpty(appHeader.getDocumentCaption()))
title = appHeader.getDocumentCaption() + ' - ' + title; title = appHeader.getDocumentCaption() + ' - ' + title;
if (isModified) { if (isModified) {

View file

@ -393,7 +393,7 @@ define([
docInfo.put_Token(data.doc.token); docInfo.put_Token(data.doc.token);
docInfo.put_Permissions(_permissions); docInfo.put_Permissions(_permissions);
this.headerView.setDocumentCaption(data.doc.title); this.headerView && this.headerView.setDocumentCaption(data.doc.title);
} }
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this)); this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
@ -1494,6 +1494,7 @@ define([
updateWindowTitle: function(change, force) { updateWindowTitle: function(change, force) {
if (this._state.isDocModified !== change || force) { if (this._state.isDocModified !== change || force) {
if (this.headerView) {
var title = this.defaultTitleText; var title = this.defaultTitleText;
if (!_.isEmpty(this.headerView.getDocumentCaption())) if (!_.isEmpty(this.headerView.getDocumentCaption()))
@ -1514,9 +1515,9 @@ define([
} else } else
this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(), false); this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(), false);
} }
if (window.document.title != title) if (window.document.title != title)
window.document.title = title; window.document.title = title;
}
Common.Gateway.setDocumentModified(change); Common.Gateway.setDocumentModified(change);