diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 746692a06..05754bc96 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -477,7 +477,7 @@ define([ $html.find('#slot-btn-back').hide(); } - if ( this.options.favorite !== undefined ) { + if ( this.options.favorite !== undefined && this.options.favorite!==null) { me.btnFavorite.render($html.find('#slot-btn-favorite')); me.btnFavorite.changeIcon(!!me.options.favorite ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'}); me.btnFavorite.updateHint(!me.options.favorite ? me.textAddFavorite : me.textRemoveFavorite); @@ -606,7 +606,7 @@ define([ setFavorite: function (value) { this.options.favorite = value; - this.btnFavorite[value!==undefined ? 'show' : 'hide'](); + this.btnFavorite[value!==undefined && value!==null ? 'show' : 'hide'](); this.btnFavorite.changeIcon(!!value ? {next: 'btn-in-favorite'} : {curr: 'btn-in-favorite'}); this.btnFavorite.updateHint(!value ? this.textAddFavorite : this.textRemoveFavorite); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 4655098e8..408c7d531 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -442,7 +442,7 @@ define([ this.permissions.edit = this.permissions.review = false; } - this.appOptions.canFavorite = data.doc.info && (data.doc.info.favorite!==undefined); + 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)); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 5110d82ad..25835ea09 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -393,7 +393,7 @@ define([ enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false); docInfo.asc_putIsEnabledPlugins(!!enable); - this.appOptions.canFavorite = data.doc.info && (data.doc.info.favorite!==undefined); + 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)); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 437ae3b1d..646ecb20b 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -446,7 +446,7 @@ define([ docInfo.asc_putIsEnabledPlugins(!!enable); this.headerView && this.headerView.setDocumentCaption(data.doc.title); - this.appOptions.canFavorite = data.doc.info && (data.doc.info.favorite!==undefined); + 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);