From fa5c9d5626879baac102e03df7238cf1afeda52f Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 20 Nov 2019 12:42:39 +0300 Subject: [PATCH] [all] changed 'notify' button state --- apps/common/main/resources/less/buttons.less | 27 +++++++++++++++++++ .../main/app/controller/Main.js | 6 ++--- .../main/app/controller/Toolbar.js | 2 +- apps/documenteditor/main/app/view/Toolbar.js | 14 ++++------ .../main/app/controller/Main.js | 6 ++--- .../main/app/controller/Toolbar.js | 4 +-- .../main/app/view/Toolbar.js | 13 ++++----- .../main/app/controller/Main.js | 4 +-- .../main/app/controller/Toolbar.js | 2 +- .../main/app/view/Toolbar.js | 13 ++++----- 10 files changed, 54 insertions(+), 37 deletions(-) diff --git a/apps/common/main/resources/less/buttons.less b/apps/common/main/resources/less/buttons.less index 5d9654e57..9b38ec6a7 100644 --- a/apps/common/main/resources/less/buttons.less +++ b/apps/common/main/resources/less/buttons.less @@ -84,6 +84,33 @@ padding: 0 4px; } } + + &.notify { + .icon { + &::after { + content: ' '; + position: absolute; + border: 1px solid #000; + border-left: 0 none; + border-right: 0 none; + width: 6px; + height: 3px; + bottom: 4px; + right: 2px; + } + + &::before { + content: ' '; + position: absolute; + width: 10px; + height: 7px; + bottom: 2px; + background-color: #ffd112; + border-radius: 2px; + right: 0; + } + } + } } .btn.icon-top, .btn-group.icon-top { diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 27e70e8a1..2679fff35 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -679,7 +679,7 @@ define([ if (this.api && this.appOptions.isEdit && !toolbarView._state.previewmode) { var cansave = this.api.asc_isDocumentCanSave(), forcesave = this.appOptions.forcesave, - isSyncButton = (toolbarView.btnCollabChanges.rendered) ? toolbarView.btnCollabChanges.$icon.hasClass('btn-synch') : false, + isSyncButton = (toolbarView.btnCollabChanges.rendered) ? toolbarView.btnCollabChanges.cmpEl.hasClass('notify') : false, isDisabled = !cansave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave; toolbarView.btnSave.setDisabled(isDisabled); } @@ -1642,7 +1642,7 @@ define([ var toolbarView = this.getApplication().getController('Toolbar').getView(); if (toolbarView && toolbarView.btnCollabChanges && !toolbarView._state.previewmode) { - var isSyncButton = toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'), + var isSyncButton = toolbarView.btnCollabChanges.cmpEl.hasClass('notify'), forcesave = this.appOptions.forcesave, isDisabled = !isModified && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave; toolbarView.btnSave.setDisabled(isDisabled); @@ -1659,7 +1659,7 @@ define([ var toolbarView = this.getApplication().getController('Toolbar').getView(); if (toolbarView && this.api && !toolbarView._state.previewmode) { - var isSyncButton = toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'), + var isSyncButton = toolbarView.btnCollabChanges.cmpEl.hasClass('notify'), forcesave = this.appOptions.forcesave, isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave; toolbarView.btnSave.setDisabled(isDisabled); diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 704255430..144770160 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -985,7 +985,7 @@ define([ var toolbar = this.toolbar; if (this.api) { var isModified = this.api.asc_isDocumentCanSave(); - var isSyncButton = toolbar.btnCollabChanges && toolbar.btnCollabChanges.$icon.hasClass('btn-synch'); + var isSyncButton = toolbar.btnCollabChanges && toolbar.btnCollabChanges.cmpEl.hasClass('notify'); if (!isModified && !isSyncButton && !toolbar.mode.forcesave) return; diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index acdb1b86a..062396d6b 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -2025,7 +2025,7 @@ define([ } this._state.hasCollaborativeChanges = true; - this.btnCollabChanges.$icon.removeClass(this.btnSaveCls).addClass('btn-synch'); + this.btnCollabChanges.cmpEl.addClass('notify'); if (this.showSynchTip) { this.btnCollabChanges.updateHint(''); if (this.synchTooltip === undefined) @@ -2061,8 +2061,8 @@ define([ if ( !this._state.previewmode && this.btnCollabChanges.rendered ) { var me = this; - if ( me.btnCollabChanges.$icon.hasClass('btn-synch') ) { - me.btnCollabChanges.$icon.removeClass('btn-synch').addClass(me.btnSaveCls); + if ( me.btnCollabChanges.cmpEl.hasClass('notify') ) { + me.btnCollabChanges.cmpEl.removeClass('notify'); if (this.synchTooltip) this.synchTooltip.hide(); this.btnCollabChanges.updateHint(this.btnSaveTip); @@ -2085,12 +2085,8 @@ define([ var cls = (length > 1) ? 'btn-save-coauth' : 'btn-save'; if ( cls !== me.btnSaveCls && me.btnCollabChanges.rendered ) { me.btnSaveTip = ((length > 1) ? me.tipSaveCoauth : me.tipSave ) + Common.Utils.String.platformKey('Ctrl+S'); - - if ( !me.btnCollabChanges.$icon.hasClass('btn-synch') ) { - me.btnCollabChanges.$icon.removeClass(me.btnSaveCls).addClass(cls); - me.btnCollabChanges.updateHint(me.btnSaveTip); - - } + me.btnCollabChanges.updateHint(me.btnSaveTip); + me.btnCollabChanges.$icon.removeClass(me.btnSaveCls).addClass(cls); me.btnSaveCls = cls; } }, diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 8ac192e66..5bbd04965 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -463,7 +463,7 @@ define([ if (this.api && this.appOptions.isEdit && this.api.asc_isDocumentCanSave) { var cansave = this.api.asc_isDocumentCanSave(), forcesave = this.appOptions.forcesave, - isSyncButton = (toolbarView.btnCollabChanges.rendered) ? toolbarView.btnCollabChanges.$icon.hasClass('btn-synch') : false, + isSyncButton = (toolbarView.btnCollabChanges.rendered) ? toolbarView.btnCollabChanges.cmpEl.hasClass('notify') : false, isDisabled = !cansave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave; toolbarView.btnSave.setDisabled(isDisabled); } @@ -1354,7 +1354,7 @@ define([ var toolbarView = this.getApplication().getController('Toolbar').getView('Toolbar'); if (toolbarView && toolbarView.btnCollabChanges) { - var isSyncButton = toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'), + var isSyncButton = toolbarView.btnCollabChanges.cmpEl.hasClass('notify'), forcesave = this.appOptions.forcesave, isDisabled = !isModified && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave; toolbarView.btnSave.setDisabled(isDisabled); @@ -1363,7 +1363,7 @@ define([ onDocumentCanSaveChanged: function (isCanSave) { var toolbarView = this.getApplication().getController('Toolbar').getView('Toolbar'); if ( toolbarView ) { - var isSyncButton = toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'), + var isSyncButton = toolbarView.btnCollabChanges.cmpEl.hasClass('notify'), forcesave = this.appOptions.forcesave, isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave; toolbarView.btnSave.setDisabled(isDisabled); diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 830ceaa55..c2f5ae14e 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -905,7 +905,7 @@ define([ var toolbar = this.toolbar; if (this.api && this.api.asc_isDocumentCanSave) { var isModified = this.api.asc_isDocumentCanSave(); - var isSyncButton = this.toolbar.btnCollabChanges && this.toolbar.btnCollabChanges.$icon.hasClass('btn-synch'); + var isSyncButton = toolbar.btnCollabChanges && toolbar.btnCollabChanges.cmpEl.hasClass('notify'); if (!isModified && !isSyncButton && !this.toolbar.mode.forcesave) return; @@ -2125,7 +2125,7 @@ define([ this.btnsComment = []; if ( config.canCoAuthoring && config.canComments ) { var _set = PE.enumLock; - this.btnsComment = Common.Utils.injectButtons(this.toolbar.$el.find('.slot-comment'), 'tlbtn-addcomment-', 'btn-menu-comments', me.toolbar.capBtnComment, [_set.lostConnect, _set.noSlides]); + this.btnsComment = Common.Utils.injectButtons(this.toolbar.$el.find('.slot-comment'), 'tlbtn-addcomment-', 'toolbar__icon btn-menu-comments', me.toolbar.capBtnComment, [_set.lostConnect, _set.noSlides]); if ( this.btnsComment.length ) { var _comments = PE.getController('Common.Controllers.Comments').getView(); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index ee4c99e5c..77bca5712 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1340,7 +1340,7 @@ define([ } this._state.hasCollaborativeChanges = true; - this.btnCollabChanges.$icon.removeClass(this.btnSaveCls).addClass('btn-synch'); + this.btnCollabChanges.cmpEl.addClass('notify'); if (this.showSynchTip) { this.btnCollabChanges.updateHint(''); if (this.synchTooltip === undefined) @@ -1376,8 +1376,8 @@ define([ if (this.btnCollabChanges.rendered) { var me = this; - if ( me.btnCollabChanges.$icon.hasClass('btn-synch') ) { - me.btnCollabChanges.$icon.removeClass('btn-synch').addClass(this.btnSaveCls); + if ( me.btnCollabChanges.cmpEl.hasClass('notify') ) { + me.btnCollabChanges.cmpEl.removeClass('notify'); if (this.synchTooltip) this.synchTooltip.hide(); this.btnCollabChanges.updateHint(this.btnSaveTip); @@ -1399,11 +1399,8 @@ define([ var cls = (length > 1) ? 'btn-save-coauth' : 'btn-save'; if (cls !== this.btnSaveCls && this.btnCollabChanges.rendered) { this.btnSaveTip = ((length > 1) ? this.tipSaveCoauth : this.tipSave ) + Common.Utils.String.platformKey('Ctrl+S'); - - if ( !this.btnCollabChanges.$icon.hasClass('btn-synch') ) { - this.btnCollabChanges.$icon.removeClass(this.btnSaveCls).addClass(cls); - this.btnCollabChanges.updateHint(this.btnSaveTip); - } + this.btnCollabChanges.updateHint(this.btnSaveTip); + this.btnCollabChanges.$icon.removeClass(this.btnSaveCls).addClass(cls); this.btnSaveCls = cls; } }, diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 9c399ae43..3489d5f97 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1539,7 +1539,7 @@ define([ Common.Gateway.setDocumentModified(change); if (this.toolbarView && this.toolbarView.btnCollabChanges && this.api) { - var isSyncButton = this.toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'), + var isSyncButton = this.toolbarView.btnCollabChanges.cmpEl.hasClass('notify'), forcesave = this.appOptions.forcesave, cansave = this.api.asc_isDocumentCanSave(), isDisabled = !cansave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave; @@ -1549,7 +1549,7 @@ define([ onDocumentCanSaveChanged: function (isCanSave) { if (this.toolbarView && this.toolbarView.btnCollabChanges) { - var isSyncButton = this.toolbarView.btnCollabChanges.$icon.hasClass('btn-synch'), + var isSyncButton = this.toolbarView.btnCollabChanges.cmpEl.hasClass('notify'), forcesave = this.appOptions.forcesave, isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave; this.toolbarView.btnSave.setDisabled(isDisabled); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index e886614c7..f1615017f 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -428,7 +428,7 @@ define([ onSave: function(e) { if (this.api) { var isModified = this.api.asc_isDocumentCanSave(); - var isSyncButton = this.toolbar.btnCollabChanges && this.toolbar.btnCollabChanges.$icon.hasClass('btn-synch'); + var isSyncButton = this.toolbar.btnCollabChanges && this.toolbar.btnCollabChanges.cmpEl.hasClass('notify'); if (!isModified && !isSyncButton && !this.toolbar.mode.forcesave) return; diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 14173f21d..464d42911 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2103,7 +2103,7 @@ define([ } this._state.hasCollaborativeChanges = true; - this.btnCollabChanges.$icon.removeClass(this.btnSaveCls).addClass('btn-synch'); + this.btnCollabChanges.cmpEl.addClass('notify'); if (this.showSynchTip){ this.btnCollabChanges.updateHint(''); @@ -2140,8 +2140,8 @@ define([ if (this.btnCollabChanges.rendered) { var me = this; - if ( me.btnCollabChanges.$icon.hasClass('btn-synch') ) { - me.btnCollabChanges.$icon.removeClass('btn-synch').addClass(this.btnSaveCls); + if ( me.btnCollabChanges.cmpEl.hasClass('notify') ) { + me.btnCollabChanges.cmpEl.removeClass('notify'); if (this.synchTooltip) this.synchTooltip.hide(); this.btnCollabChanges.updateHint(this.btnSaveTip); @@ -2163,11 +2163,8 @@ define([ var cls = (length>1) ? 'btn-save-coauth' : 'btn-save'; if (cls !== this.btnSaveCls && this.btnCollabChanges.rendered) { this.btnSaveTip = ((length>1) ? this.tipSaveCoauth : this.tipSave )+ Common.Utils.String.platformKey('Ctrl+S'); - - if ( !this.btnCollabChanges.$icon.hasClass('btn-synch') ) { - this.btnCollabChanges.$icon.removeClass(this.btnSaveCls).addClass(cls); - this.btnCollabChanges.updateHint(this.btnSaveTip); - } + this.btnCollabChanges.updateHint(this.btnSaveTip); + this.btnCollabChanges.$icon.removeClass(this.btnSaveCls).addClass(cls); this.btnSaveCls = cls; } },