[all] changed 'notify' button state

This commit is contained in:
Maxim Kadushkin 2019-11-20 12:42:39 +03:00
parent 00caf68082
commit fa5c9d5626
10 changed files with 54 additions and 37 deletions

View file

@ -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 {

View file

@ -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);

View file

@ -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;

View file

@ -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.$icon.removeClass(me.btnSaveCls).addClass(cls);
me.btnSaveCls = cls;
}
},

View file

@ -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);

View file

@ -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();

View file

@ -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.$icon.removeClass(this.btnSaveCls).addClass(cls);
this.btnSaveCls = cls;
}
},

View file

@ -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);

View file

@ -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;

View file

@ -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.$icon.removeClass(this.btnSaveCls).addClass(cls);
this.btnSaveCls = cls;
}
},