Commit 8e7c1761 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил отправку эвента о начале сохранения (для autoSave его нужно отправить позднее)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48653 954022d7-b5bf-4e40-9824-e11837661b57
parent 341fa090
...@@ -2240,10 +2240,11 @@ asc_docs_api.prototype.Share = function(){ ...@@ -2240,10 +2240,11 @@ asc_docs_api.prototype.Share = function(){
asc_docs_api.prototype.asc_Save = function (isAutoSave) { asc_docs_api.prototype.asc_Save = function (isAutoSave) {
if(true === this.canSave) { if(true === this.canSave) {
this.canSave = false; this.canSave = false;
editor.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
this.isAutoSave = !!isAutoSave; this.isAutoSave = !!isAutoSave;
if (!this.isAutoSave) if (!this.isAutoSave) {
editor.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
editor.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.PrepareToSave); editor.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.PrepareToSave);
}
this.CoAuthoringApi.askSaveChanges( OnSave_Callback ); this.CoAuthoringApi.askSaveChanges( OnSave_Callback );
} }
...@@ -2253,13 +2254,11 @@ asc_docs_api.prototype.asc_OnSaveEnd = function (isDocumentSaved) { ...@@ -2253,13 +2254,11 @@ asc_docs_api.prototype.asc_OnSaveEnd = function (isDocumentSaved) {
this.canSave = true; this.canSave = true;
this.isAutoSave = false; this.isAutoSave = false;
editor.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save); editor.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
if (isDocumentSaved) {
editor.CoAuthoringApi.unSaveChanges(); editor.CoAuthoringApi.unSaveChanges();
if (isDocumentSaved) {
// Запускаем таймер автосохранения // Запускаем таймер автосохранения
this.autoSaveInit(); this.autoSaveInit();
} else { } else {
editor.CoAuthoringApi.unSaveChanges();
editor.CoAuthoringApi.logout(); editor.CoAuthoringApi.logout();
} }
}; };
...@@ -2267,8 +2266,10 @@ function OnSave_Callback(e) ...@@ -2267,8 +2266,10 @@ function OnSave_Callback(e)
{ {
var nState; var nState;
if ( false == e["savelock"] ) { if ( false == e["savelock"] ) {
if (editor.isAutoSave) if (editor.isAutoSave) {
editor.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
editor.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.PrepareToSave); editor.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.PrepareToSave);
}
if ( c_oAscCollaborativeMarksShowType.LastChanges === editor.CollaborativeMarksShowType ) if ( c_oAscCollaborativeMarksShowType.LastChanges === editor.CollaborativeMarksShowType )
CollaborativeEditing.Clear_CollaborativeMarks(); CollaborativeEditing.Clear_CollaborativeMarks();
...@@ -2316,9 +2317,10 @@ function OnSave_Callback(e) ...@@ -2316,9 +2317,10 @@ function OnSave_Callback(e)
nState = editor.CoAuthoringApi.get_state(); nState = editor.CoAuthoringApi.get_state();
if (3 === nState) { if (3 === nState) {
// Отключаемся от сохранения, соединение потеряно // Отключаемся от сохранения, соединение потеряно
if (!editor.isAutoSave) if (!editor.isAutoSave) {
editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.PrepareToSave); editor.sync_EndAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.PrepareToSave);
editor.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save); editor.sync_EndAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
}
editor.isAutoSave = false; editor.isAutoSave = false;
editor.canSave = true; editor.canSave = true;
} else { } else {
...@@ -2519,6 +2521,7 @@ asc_docs_api.prototype.sync_DownloadAsCallBack = function(){ ...@@ -2519,6 +2521,7 @@ asc_docs_api.prototype.sync_DownloadAsCallBack = function(){
asc_docs_api.prototype.sync_StartAction = function(type, id){ asc_docs_api.prototype.sync_StartAction = function(type, id){
//this.AsyncAction //this.AsyncAction
this.asc_fireCallback("asc_onStartAction", type, id); this.asc_fireCallback("asc_onStartAction", type, id);
//console.log("asc_onStartAction: type = " + type + " id = " + id);
if (c_oAscAsyncActionType.BlockInteraction == type) if (c_oAscAsyncActionType.BlockInteraction == type)
this.IsLongActionCurrent = true; this.IsLongActionCurrent = true;
...@@ -2526,6 +2529,7 @@ asc_docs_api.prototype.sync_StartAction = function(type, id){ ...@@ -2526,6 +2529,7 @@ asc_docs_api.prototype.sync_StartAction = function(type, id){
asc_docs_api.prototype.sync_EndAction = function(type, id){ asc_docs_api.prototype.sync_EndAction = function(type, id){
//this.AsyncAction //this.AsyncAction
this.asc_fireCallback("asc_onEndAction", type, id); this.asc_fireCallback("asc_onEndAction", type, id);
//console.log("asc_onEndAction: type = " + type + " id = " + id);
if (c_oAscAsyncActionType.BlockInteraction == type) if (c_oAscAsyncActionType.BlockInteraction == type)
this.IsLongActionCurrent = false; this.IsLongActionCurrent = false;
......
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