Disable favorite button for offline files

This commit is contained in:
Julia Radzhabova 2020-12-21 14:07:00 +03:00
parent 678139bd79
commit dbfcca5652
3 changed files with 9 additions and 9 deletions

View file

@ -441,8 +441,6 @@ define([
if (type && typeof type[1] === 'string') {
this.permissions.edit = this.permissions.review = false;
}
this.appOptions.canFavorite = data.doc.info && (data.doc.info.favorite!==undefined && data.doc.info.favorite!==null);
}
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
@ -454,7 +452,6 @@ define([
if (data.doc) {
appHeader.setDocumentCaption(data.doc.title);
}
this.appOptions.canFavorite && appHeader.setFavorite(data.doc.info.favorite);
},
onProcessSaveResult: function(data) {
@ -1298,6 +1295,9 @@ define([
if (this.appOptions.canBranding)
appHeader.setBranding(this.editorConfig.customization);
this.appOptions.canFavorite = this.document.info && (this.document.info.favorite!==undefined && this.document.info.favorite!==null) && !this.appOptions.isOffline;
this.appOptions.canFavorite && appHeader.setFavorite(this.document.info.favorite);
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object');
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(this.appOptions.user.fullname));

View file

@ -392,8 +392,6 @@ define([
docInfo.asc_putIsEnabledMacroses(!!enable);
enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false);
docInfo.asc_putIsEnabledPlugins(!!enable);
this.appOptions.canFavorite = data.doc.info && (data.doc.info.favorite!==undefined && data.doc.info.favorite!==null);
}
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
@ -405,7 +403,6 @@ define([
if (data.doc) {
appHeader.setDocumentCaption(data.doc.title);
}
this.appOptions.canFavorite && appHeader.setFavorite(data.doc.info.favorite);
},
onProcessSaveResult: function(data) {
@ -999,6 +996,9 @@ define([
if (this.appOptions.canBranding)
appHeader.setBranding(this.editorConfig.customization);
this.appOptions.canFavorite = this.document.info && (this.document.info.favorite!==undefined && this.document.info.favorite!==null) && !this.appOptions.isOffline;
this.appOptions.canFavorite && appHeader.setFavorite(this.document.info.favorite);
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object');
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(this.appOptions.user.fullname));

View file

@ -446,9 +446,6 @@ define([
docInfo.asc_putIsEnabledPlugins(!!enable);
this.headerView && this.headerView.setDocumentCaption(data.doc.title);
this.appOptions.canFavorite = data.doc.info && (data.doc.info.favorite!==undefined && data.doc.info.favorite!==null);
this.appOptions.canFavorite && this.headerView && this.headerView.setFavorite(data.doc.info.favorite);
Common.Utils.InternalSettings.set("sse-doc-info-key", data.doc.key);
}
@ -1053,6 +1050,9 @@ define([
if (this.appOptions.canBranding)
this.headerView.setBranding(this.editorConfig.customization);
this.appOptions.canFavorite = this.appOptions.spreadsheet.info && (this.appOptions.spreadsheet.info.favorite!==undefined && this.appOptions.spreadsheet.info.favorite!==null);
this.appOptions.canFavorite && this.headerView && this.headerView.setFavorite(this.appOptions.spreadsheet.info.favorite);
this.appOptions.canRename && this.headerView.setCanRename(true);
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object');
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);