Fix bug for desktop
This commit is contained in:
parent
614109a26f
commit
3cc0e9b5bd
|
@ -1600,7 +1600,7 @@ define([
|
|||
if (this._state.isDocModified !== isModified || force) {
|
||||
var title = this.defaultTitleText;
|
||||
|
||||
if (!_.isEmpty(appHeader.getDocumentCaption()))
|
||||
if (appHeader && !_.isEmpty(appHeader.getDocumentCaption()))
|
||||
title = appHeader.getDocumentCaption() + ' - ' + title;
|
||||
|
||||
if (isModified) {
|
||||
|
|
|
@ -1311,7 +1311,7 @@ define([
|
|||
if (this._state.isDocModified !== isModified || force) {
|
||||
var title = this.defaultTitleText;
|
||||
|
||||
if (!_.isEmpty(appHeader.getDocumentCaption()))
|
||||
if (appHeader && !_.isEmpty(appHeader.getDocumentCaption()))
|
||||
title = appHeader.getDocumentCaption() + ' - ' + title;
|
||||
|
||||
if (isModified) {
|
||||
|
|
|
@ -393,7 +393,7 @@ define([
|
|||
docInfo.put_Token(data.doc.token);
|
||||
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));
|
||||
|
@ -1494,30 +1494,31 @@ define([
|
|||
|
||||
updateWindowTitle: function(change, force) {
|
||||
if (this._state.isDocModified !== change || force) {
|
||||
var title = this.defaultTitleText;
|
||||
if (this.headerView) {
|
||||
var title = this.defaultTitleText;
|
||||
|
||||
if (!_.isEmpty(this.headerView.getDocumentCaption()))
|
||||
title = this.headerView.getDocumentCaption() + ' - ' + title;
|
||||
if (!_.isEmpty(this.headerView.getDocumentCaption()))
|
||||
title = this.headerView.getDocumentCaption() + ' - ' + title;
|
||||
|
||||
if (change) {
|
||||
clearTimeout(this._state.timerCaption);
|
||||
if (!_.isUndefined(title)) {
|
||||
title = '* ' + title;
|
||||
this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(), true);
|
||||
if (change) {
|
||||
clearTimeout(this._state.timerCaption);
|
||||
if (!_.isUndefined(title)) {
|
||||
title = '* ' + title;
|
||||
this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(), true);
|
||||
}
|
||||
} else {
|
||||
if (this._state.fastCoauth && this._state.usersCount>1) {
|
||||
var me = this;
|
||||
this._state.timerCaption = setTimeout(function () {
|
||||
me.headerView.setDocumentCaption(me.headerView.getDocumentCaption(), false);
|
||||
}, 500);
|
||||
} else
|
||||
this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(), false);
|
||||
}
|
||||
} else {
|
||||
if (this._state.fastCoauth && this._state.usersCount>1) {
|
||||
var me = this;
|
||||
this._state.timerCaption = setTimeout(function () {
|
||||
me.headerView.setDocumentCaption(me.headerView.getDocumentCaption(), false);
|
||||
}, 500);
|
||||
} else
|
||||
this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(), false);
|
||||
if (window.document.title != title)
|
||||
window.document.title = title;
|
||||
}
|
||||
|
||||
if (window.document.title != title)
|
||||
window.document.title = title;
|
||||
|
||||
Common.Gateway.setDocumentModified(change);
|
||||
|
||||
this._state.isDocModified = change;
|
||||
|
|
Loading…
Reference in a new issue