[component] refactoring

This commit is contained in:
Maxim Kadushkin 2019-11-06 16:50:12 +03:00
parent a72d14d421
commit e8a746ab37
4 changed files with 17 additions and 17 deletions

View file

@ -650,8 +650,8 @@ define([
changeIcon: function(opts) {
var me = this;
if ( opts && (opts.prev || opts.next)) {
!!opts.prev && (me.$icon.removeClass(opts.prev));
if ( opts && (opts.curr || opts.next)) {
!!opts.curr && (me.$icon.removeClass(opts.curr));
!!opts.next && !me.$icon.hasClass(opts.next) && (me.$icon.addClass(opts.next));
if ( !!me.options.signals ) {

View file

@ -2025,7 +2025,7 @@ define([
}
this._state.hasCollaborativeChanges = true;
this.btnCollabChanges.changeIcon({prev:this.btnSaveCls, next:'btn-synch'});
this.btnCollabChanges.changeIcon({curr:this.btnSaveCls, next:'btn-synch'});
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.isIcon('btn-synch') ) {
me.btnCollabChanges.changeIcon({prev:'btn-synch', next:me.btnSaveCls});
if ( me.btnCollabChanges.hasIcon('btn-synch') ) {
me.btnCollabChanges.changeIcon({curr:'btn-synch', next:me.btnSaveCls});
if (this.synchTooltip)
this.synchTooltip.hide();
this.btnCollabChanges.updateHint(this.btnSaveTip);
@ -2086,8 +2086,8 @@ define([
if ( cls !== me.btnSaveCls && me.btnCollabChanges.rendered ) {
me.btnSaveTip = ((length > 1) ? me.tipSaveCoauth : me.tipSave ) + Common.Utils.String.platformKey('Ctrl+S');
if ( !me.btnCollabChanges.isIcon('btn-synch') ) {
me.btnCollabChanges.changeIcon({prev:me.btnSaveCls, next:cls});
if ( !me.btnCollabChanges.hasIcon('btn-synch') ) {
me.btnCollabChanges.changeIcon({curr:me.btnSaveCls, next:cls});
me.btnCollabChanges.updateHint(me.btnSaveTip);
}
me.btnSaveCls = cls;

View file

@ -1340,7 +1340,7 @@ define([
}
this._state.hasCollaborativeChanges = true;
this.btnCollabChanges.$icon.removeClass(this.btnSaveCls).addClass('btn-synch');
this.btnCollabChanges.changeIcon({curr:this.btnSaveCls, next:'btn-synch'});
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.hasIcon('btn-synch') ) {
me.btnCollabChanges.changeIcon({curr:'btn-synch', next:this.btnSaveCls});
if (this.synchTooltip)
this.synchTooltip.hide();
this.btnCollabChanges.updateHint(this.btnSaveTip);
@ -1400,8 +1400,8 @@ define([
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);
if ( !this.btnCollabChanges.hasIcon('btn-synch') ) {
this.btnCollabChanges.changeIcon({curr: this.btnSaveCls, next:cls});
this.btnCollabChanges.updateHint(this.btnSaveTip);
}
this.btnSaveCls = cls;

View file

@ -2103,7 +2103,7 @@ define([
}
this._state.hasCollaborativeChanges = true;
this.btnCollabChanges.$icon.removeClass(this.btnSaveCls).addClass('btn-synch');
this.btnCollabChanges.changeIcon({curr:this.btnSaveCls,next:'btn-synch'});
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.hasIcon('btn-synch') ) {
me.btnCollabChanges.changeIcon({curr:'btn-synch',next:this.btnSaveCls});
if (this.synchTooltip)
this.synchTooltip.hide();
this.btnCollabChanges.updateHint(this.btnSaveTip);
@ -2164,8 +2164,8 @@ define([
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);
if ( !this.btnCollabChanges.hasIcon('btn-synch') ) {
this.btnCollabChanges.changeIcon({curr:this.btnSaveCls, next:cls});
this.btnCollabChanges.updateHint(this.btnSaveTip);
}
this.btnSaveCls = cls;