diff --git a/apps/common/main/lib/component/Button.js b/apps/common/main/lib/component/Button.js index 936ea7eeb..774de1cde 100644 --- a/apps/common/main/lib/component/Button.js +++ b/apps/common/main/lib/component/Button.js @@ -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 ) { diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index d5bb63c36..651dd6373 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.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; diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index ee4c99e5c..50044986b 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.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; diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 14173f21d..eb15a39e6 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.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;