From 35319df3f69c3c3845790b65ea32ed2f5f5eef4b Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Fri, 8 Oct 2021 20:00:17 +0300 Subject: [PATCH] Fix alt hints in view mode --- apps/common/main/lib/view/Header.js | 8 ++++---- apps/spreadsheeteditor/main/app/view/Statusbar.js | 13 ++++++++++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index d17a6a00f..7a34a8193 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -536,13 +536,13 @@ define([ if ( !config.isEdit ) { if ( (config.canDownload || config.canDownloadOrigin) && !config.isOffline ) - this.btnDownload = createTitleButton('toolbar__icon icon--inverse btn-download', $html.findById('#slot-hbtn-download')); + this.btnDownload = createTitleButton('toolbar__icon icon--inverse btn-download', $html.findById('#slot-hbtn-download'), undefined, 'bottom', 'big'); if ( config.canPrint ) - this.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-hbtn-print')); + this.btnPrint = createTitleButton('toolbar__icon icon--inverse btn-print', $html.findById('#slot-hbtn-print'), undefined, 'bottom', 'big'); if ( config.canEdit && config.canRequestEditRights ) - this.btnEdit = createTitleButton('toolbar__icon icon--inverse btn-edit', $html.findById('#slot-hbtn-edit')); + this.btnEdit = createTitleButton('toolbar__icon icon--inverse btn-edit', $html.findById('#slot-hbtn-edit'), undefined, 'bottom', 'big'); } me.btnOptions.render($html.find('#slot-btn-options')); @@ -759,7 +759,7 @@ define([ if ( alias == 'users' ) { if ( lock ) $btnUsers.addClass('disabled').attr('disabled', 'disabled'); else - $btnUsers.removeClass('disabled').attr('disabled', ''); + $btnUsers.removeClass('disabled').removeAttr('disabled'); } else if ( alias == 'rename-user' ) { if (me.labelUserName) { if ( lock ) { diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index b9038e94a..699080041 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -513,7 +513,8 @@ define([ setMode: function(mode) { this.mode = _.extend({}, this.mode, mode); // this.$el.find('.el-edit')[mode.isEdit?'show':'hide'](); - this.btnAddWorksheet.setVisible(this.mode.isEdit); + //this.btnAddWorksheet.setVisible(this.mode.isEdit); + $('#status-addtabs-box')[this.mode.isEdit ? 'show' : 'hide'](); this.btnAddWorksheet.setDisabled(this.mode.isDisconnected || this.api && (this.api.asc_isWorkbookLocked() || this.api.isCellEdited) || this.rangeSelectionMode!=Asc.c_oAscSelectionDialogType.None); this.updateTabbarBorders(); }, @@ -600,7 +601,11 @@ define([ this.tabbar.setTabVisible(sindex); this.btnAddWorksheet.setDisabled(me.mode.isDisconnected || me.api.asc_isWorkbookLocked() || me.api.asc_isProtectedWorkbook() || me.api.isCellEdited); - this.tabbar.addDataHint(_.findIndex(items, function (item) { return item.sheetindex === sindex; })); + if (this.mode.isEdit) { + this.tabbar.addDataHint(_.findIndex(items, function (item) { + return item.sheetindex === sindex; + })); + } $('#status-label-zoom').text(Common.Utils.String.format(this.zoomText, Math.floor((this.api.asc_getZoom() +.005)*100))); @@ -687,7 +692,9 @@ define([ this.tabbar.setTabVisible(index); } - this.tabbar.addDataHint(index); + if (this.mode.isEdit) { + this.tabbar.addDataHint(index); + } this.fireEvent('sheet:changed', [this, tab.sheetindex]); this.fireEvent('sheet:updateColors', [true]);