[component] refactoring
This commit is contained in:
parent
a72d14d421
commit
e8a746ab37
|
@ -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 ) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue