Disable favorite button for offline files
This commit is contained in:
parent
678139bd79
commit
dbfcca5652
|
@ -441,8 +441,6 @@ define([
|
||||||
if (type && typeof type[1] === 'string') {
|
if (type && typeof type[1] === 'string') {
|
||||||
this.permissions.edit = this.permissions.review = false;
|
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));
|
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
|
||||||
|
@ -454,7 +452,6 @@ define([
|
||||||
if (data.doc) {
|
if (data.doc) {
|
||||||
appHeader.setDocumentCaption(data.doc.title);
|
appHeader.setDocumentCaption(data.doc.title);
|
||||||
}
|
}
|
||||||
this.appOptions.canFavorite && appHeader.setFavorite(data.doc.info.favorite);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onProcessSaveResult: function(data) {
|
onProcessSaveResult: function(data) {
|
||||||
|
@ -1298,6 +1295,9 @@ define([
|
||||||
if (this.appOptions.canBranding)
|
if (this.appOptions.canBranding)
|
||||||
appHeader.setBranding(this.editorConfig.customization);
|
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');
|
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);
|
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
|
||||||
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(this.appOptions.user.fullname));
|
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(this.appOptions.user.fullname));
|
||||||
|
|
|
@ -392,8 +392,6 @@ define([
|
||||||
docInfo.asc_putIsEnabledMacroses(!!enable);
|
docInfo.asc_putIsEnabledMacroses(!!enable);
|
||||||
enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false);
|
enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false);
|
||||||
docInfo.asc_putIsEnabledPlugins(!!enable);
|
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));
|
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
|
||||||
|
@ -405,7 +403,6 @@ define([
|
||||||
if (data.doc) {
|
if (data.doc) {
|
||||||
appHeader.setDocumentCaption(data.doc.title);
|
appHeader.setDocumentCaption(data.doc.title);
|
||||||
}
|
}
|
||||||
this.appOptions.canFavorite && appHeader.setFavorite(data.doc.info.favorite);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onProcessSaveResult: function(data) {
|
onProcessSaveResult: function(data) {
|
||||||
|
@ -999,6 +996,9 @@ define([
|
||||||
if (this.appOptions.canBranding)
|
if (this.appOptions.canBranding)
|
||||||
appHeader.setBranding(this.editorConfig.customization);
|
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');
|
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);
|
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
|
||||||
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(this.appOptions.user.fullname));
|
appHeader.setUserName(Common.Utils.UserInfoParser.getParsedName(this.appOptions.user.fullname));
|
||||||
|
|
|
@ -446,9 +446,6 @@ define([
|
||||||
docInfo.asc_putIsEnabledPlugins(!!enable);
|
docInfo.asc_putIsEnabledPlugins(!!enable);
|
||||||
|
|
||||||
this.headerView && this.headerView.setDocumentCaption(data.doc.title);
|
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);
|
Common.Utils.InternalSettings.set("sse-doc-info-key", data.doc.key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1053,6 +1050,9 @@ define([
|
||||||
if (this.appOptions.canBranding)
|
if (this.appOptions.canBranding)
|
||||||
this.headerView.setBranding(this.editorConfig.customization);
|
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.canRename && this.headerView.setCanRename(true);
|
||||||
this.appOptions.canUseReviewPermissions = this.appOptions.canLicense && this.editorConfig.customization && this.editorConfig.customization.reviewPermissions && (typeof (this.editorConfig.customization.reviewPermissions) == 'object');
|
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);
|
Common.Utils.UserInfoParser.setParser(this.appOptions.canUseReviewPermissions);
|
||||||
|
|
Loading…
Reference in a new issue