Commit 3de78e58 authored by Julia Radzhabova's avatar Julia Radzhabova

Refactoring.

parent 0f7b20c9
......@@ -575,14 +575,9 @@ define([
if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) {
if (this._state.fastCoauth && this._state.usersCount>1) {
var me = this;
if (me._state.timerSave===undefined)
me._state.timerSave = setInterval(function(){
if ((new Date()) - me._state.isSaving>500) {
clearInterval(me._state.timerSave);
me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
me._state.timerSave = undefined;
}
}, 500);
me._state.timerSave = setTimeout(function () {
me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
}, 500);
} else
this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000);
} else
......@@ -614,7 +609,7 @@ define([
case Asc.c_oAscAsyncAction['Save']:
case Asc.c_oAscAsyncAction['ForceSaveButton']:
this._state.isSaving = new Date();
clearTimeout(this._state.timerSave);
force = true;
title = this.saveTitleText;
text = this.saveTextText;
......
......@@ -312,14 +312,9 @@ define([
me.setLongActionView(action)
} else {
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
if (me._state.timerSave===undefined)
me._state.timerSave = setInterval(function(){
if ((new Date()) - me._state.isSaving>500) {
clearInterval(me._state.timerSave);
//console.debug('End long action');
me._state.timerSave = undefined;
}
}, 500);
// me._state.timerSave = setTimeout(function () {
//console.debug('End long action');
// }, 500);
} else {
// console.debug('End long action');
}
......@@ -352,7 +347,7 @@ define([
break;
case Asc.c_oAscAsyncAction['Save']:
me._state.isSaving = new Date();
// clearTimeout(this._state.timerSave);
title = me.saveTitleText;
text = me.saveTextText;
break;
......
......@@ -389,14 +389,9 @@ define([
if (id==Asc.c_oAscAsyncAction['Save'] || id==Asc.c_oAscAsyncAction['ForceSaveButton']) {
if (this._state.fastCoauth && this._state.usersCount>1) {
var me = this;
if (me._state.timerSave===undefined)
me._state.timerSave = setInterval(function(){
if ((new Date()) - me._state.isSaving>500) {
clearInterval(me._state.timerSave);
me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
me._state.timerSave = undefined;
}
}, 500);
me._state.timerSave = setTimeout(function () {
me.getApplication().getController('Statusbar').setStatusCaption(me.textChangesSaved, false, 3000);
}, 500);
} else
this.getApplication().getController('Statusbar').setStatusCaption(this.textChangesSaved, false, 3000);
} else
......@@ -426,7 +421,7 @@ define([
case Asc.c_oAscAsyncAction['Save']:
case Asc.c_oAscAsyncAction['ForceSaveButton']:
this._state.isSaving = new Date();
clearTimeout(this._state.timerSave);
force = true;
title = this.saveTitleText;
text = this.saveTextText;
......
......@@ -302,14 +302,9 @@ define([
me.setLongActionView(action)
} else {
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
if (me._state.timerSave===undefined)
me._state.timerSave = setInterval(function(){
if ((new Date()) - me._state.isSaving>500) {
clearInterval(me._state.timerSave);
//console.debug('End long action');
me._state.timerSave = undefined;
}
}, 500);
// me._state.timerSave = setTimeout(function () {
//console.debug('End long action');
// }, 500);
} else {
// console.debug('End long action');
}
......@@ -342,7 +337,7 @@ define([
break;
case Asc.c_oAscAsyncAction['Save']:
me._state.isSaving = new Date();
// clearTimeout(me._state.timerSave);
title = me.saveTitleText;
text = me.saveTextText;
break;
......
......@@ -305,15 +305,9 @@ define([
me.setLongActionView(action)
} else {
if (me._state.fastCoauth && me._state.usersCount>1 && id==Asc.c_oAscAsyncAction['Save']) {
var me = me;
if (me._state.timerSave===undefined)
me._state.timerSave = setInterval(function(){
if ((new Date()) - me._state.isSaving>500) {
clearInterval(me._state.timerSave);
// console.debug('End long action');
me._state.timerSave = undefined;
}
}, 500);
// me._state.timerSave = setTimeout(function () {
//console.debug('End long action');
// }, 500);
} else {
// console.debug('End long action');
}
......@@ -346,7 +340,7 @@ define([
break;
case Asc.c_oAscAsyncAction['Save']:
me._state.isSaving = new Date();
// clearTimeout(me._state.timerSave);
title = me.saveTitleText;
text = me.saveTextText;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment