Refactoring.
This commit is contained in:
parent
0f7b20c9a6
commit
3de78e5815
|
|
@ -575,14 +575,9 @@ define([
|
||||||
if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) {
|
if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) {
|
||||||
if (this._state.fastCoauth && this._state.usersCount>1) {
|
if (this._state.fastCoauth && this._state.usersCount>1) {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (me._state.timerSave===undefined)
|
me._state.timerSave = setTimeout(function () {
|
||||||
me._state.timerSave = setInterval(function(){
|
me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
|
||||||
if ((new Date()) - me._state.isSaving>500) {
|
}, 500);
|
||||||
clearInterval(me._state.timerSave);
|
|
||||||
me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
|
|
||||||
me._state.timerSave = undefined;
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
} else
|
} else
|
||||||
this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000);
|
this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000);
|
||||||
} else
|
} else
|
||||||
|
|
@ -614,7 +609,7 @@ define([
|
||||||
|
|
||||||
case Asc.c_oAscAsyncAction['Save']:
|
case Asc.c_oAscAsyncAction['Save']:
|
||||||
case Asc.c_oAscAsyncAction['ForceSaveButton']:
|
case Asc.c_oAscAsyncAction['ForceSaveButton']:
|
||||||
this._state.isSaving = new Date();
|
clearTimeout(this._state.timerSave);
|
||||||
force = true;
|
force = true;
|
||||||
title = this.saveTitleText;
|
title = this.saveTitleText;
|
||||||
text = this.saveTextText;
|
text = this.saveTextText;
|
||||||
|
|
|
||||||
|
|
@ -312,14 +312,9 @@ define([
|
||||||
me.setLongActionView(action)
|
me.setLongActionView(action)
|
||||||
} else {
|
} else {
|
||||||
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
|
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
|
||||||
if (me._state.timerSave===undefined)
|
// me._state.timerSave = setTimeout(function () {
|
||||||
me._state.timerSave = setInterval(function(){
|
//console.debug('End long action');
|
||||||
if ((new Date()) - me._state.isSaving>500) {
|
// }, 500);
|
||||||
clearInterval(me._state.timerSave);
|
|
||||||
//console.debug('End long action');
|
|
||||||
me._state.timerSave = undefined;
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
} else {
|
} else {
|
||||||
// console.debug('End long action');
|
// console.debug('End long action');
|
||||||
}
|
}
|
||||||
|
|
@ -352,7 +347,7 @@ define([
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Asc.c_oAscAsyncAction['Save']:
|
case Asc.c_oAscAsyncAction['Save']:
|
||||||
me._state.isSaving = new Date();
|
// clearTimeout(this._state.timerSave);
|
||||||
title = me.saveTitleText;
|
title = me.saveTitleText;
|
||||||
text = me.saveTextText;
|
text = me.saveTextText;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -389,14 +389,9 @@ define([
|
||||||
if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) {
|
if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) {
|
||||||
if (this._state.fastCoauth && this._state.usersCount>1) {
|
if (this._state.fastCoauth && this._state.usersCount>1) {
|
||||||
var me = this;
|
var me = this;
|
||||||
if (me._state.timerSave===undefined)
|
me._state.timerSave = setTimeout(function () {
|
||||||
me._state.timerSave = setInterval(function(){
|
me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
|
||||||
if ((new Date()) - me._state.isSaving>500) {
|
}, 500);
|
||||||
clearInterval(me._state.timerSave);
|
|
||||||
me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
|
|
||||||
me._state.timerSave = undefined;
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
} else
|
} else
|
||||||
this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000);
|
this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000);
|
||||||
} else
|
} else
|
||||||
|
|
@ -426,7 +421,7 @@ define([
|
||||||
|
|
||||||
case Asc.c_oAscAsyncAction['Save']:
|
case Asc.c_oAscAsyncAction['Save']:
|
||||||
case Asc.c_oAscAsyncAction['ForceSaveButton']:
|
case Asc.c_oAscAsyncAction['ForceSaveButton']:
|
||||||
this._state.isSaving = new Date();
|
clearTimeout(this._state.timerSave);
|
||||||
force = true;
|
force = true;
|
||||||
title = this.saveTitleText;
|
title = this.saveTitleText;
|
||||||
text = this.saveTextText;
|
text = this.saveTextText;
|
||||||
|
|
|
||||||
|
|
@ -302,14 +302,9 @@ define([
|
||||||
me.setLongActionView(action)
|
me.setLongActionView(action)
|
||||||
} else {
|
} else {
|
||||||
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
|
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
|
||||||
if (me._state.timerSave===undefined)
|
// me._state.timerSave = setTimeout(function () {
|
||||||
me._state.timerSave = setInterval(function(){
|
//console.debug('End long action');
|
||||||
if ((new Date()) - me._state.isSaving>500) {
|
// }, 500);
|
||||||
clearInterval(me._state.timerSave);
|
|
||||||
//console.debug('End long action');
|
|
||||||
me._state.timerSave = undefined;
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
} else {
|
} else {
|
||||||
// console.debug('End long action');
|
// console.debug('End long action');
|
||||||
}
|
}
|
||||||
|
|
@ -342,7 +337,7 @@ define([
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Asc.c_oAscAsyncAction['Save']:
|
case Asc.c_oAscAsyncAction['Save']:
|
||||||
me._state.isSaving = new Date();
|
// clearTimeout(me._state.timerSave);
|
||||||
title = me.saveTitleText;
|
title = me.saveTitleText;
|
||||||
text = me.saveTextText;
|
text = me.saveTextText;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -305,15 +305,9 @@ define([
|
||||||
me.setLongActionView(action)
|
me.setLongActionView(action)
|
||||||
} else {
|
} else {
|
||||||
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
|
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
|
||||||
var me = me;
|
// me._state.timerSave = setTimeout(function () {
|
||||||
if (me._state.timerSave===undefined)
|
//console.debug('End long action');
|
||||||
me._state.timerSave = setInterval(function(){
|
// }, 500);
|
||||||
if ((new Date()) - me._state.isSaving>500) {
|
|
||||||
clearInterval(me._state.timerSave);
|
|
||||||
// console.debug('End long action');
|
|
||||||
me._state.timerSave = undefined;
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
} else {
|
} else {
|
||||||
// console.debug('End long action');
|
// console.debug('End long action');
|
||||||
}
|
}
|
||||||
|
|
@ -346,7 +340,7 @@ define([
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Asc.c_oAscAsyncAction['Save']:
|
case Asc.c_oAscAsyncAction['Save']:
|
||||||
me._state.isSaving = new Date();
|
// clearTimeout(me._state.timerSave);
|
||||||
title = me.saveTitleText;
|
title = me.saveTitleText;
|
||||||
text = me.saveTextText;
|
text = me.saveTextText;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue