Commit 482280c2 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix start co authoring when first user long save and second user connect in this time

parent f2a366fc
...@@ -312,28 +312,29 @@ var editor; ...@@ -312,28 +312,29 @@ var editor;
this._asc_downloadAs(typeFile, c_oAscAsyncAction.DownloadAs, {downloadType: bIsDownloadEvent ? DownloadType.Download: DownloadType.None}); this._asc_downloadAs(typeFile, c_oAscAsyncAction.DownloadAs, {downloadType: bIsDownloadEvent ? DownloadType.Download: DownloadType.None});
}; };
spreadsheet_api.prototype.asc_Save = function(isAutoSave) { spreadsheet_api.prototype.asc_Save = function (isAutoSave) {
if (!this.canSave || this.isChartEditor || c_oAscAdvancedOptionsAction.None !== this.advancedOptionsAction || if (!this.canSave || this.isChartEditor || c_oAscAdvancedOptionsAction.None !== this.advancedOptionsAction ||
this.isLongAction() || !(this.asc_isDocumentCanSave() || this.collaborativeEditing.haveOtherChanges())) { this.isLongAction() ||
return; !(this.asc_isDocumentCanSave() || this.collaborativeEditing.haveOtherChanges() || this.canUnlockDocument)) {
} return;
}
this.IsUserSave = !isAutoSave; this.IsUserSave = !isAutoSave;
if (this.IsUserSave) { if (this.IsUserSave) {
this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save); this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
} }
/* Нужно закрыть редактор (до выставления флага canSave, т.к. мы должны успеть отправить /* Нужно закрыть редактор (до выставления флага canSave, т.к. мы должны успеть отправить
asc_onDocumentModifiedChanged для подписки на сборку) Баг http://bugzilla.onlyoffice.com/show_bug.cgi?id=28331 */ asc_onDocumentModifiedChanged для подписки на сборку) Баг http://bugzilla.onlyoffice.com/show_bug.cgi?id=28331 */
this.asc_closeCellEditor(); this.asc_closeCellEditor();
// Не даем пользователю сохранять, пока не закончится сохранение // Не даем пользователю сохранять, пока не закончится сохранение
this.canSave = false; this.canSave = false;
var t = this; var t = this;
this.CoAuthoringApi.askSaveChanges(function(e) { this.CoAuthoringApi.askSaveChanges(function (e) {
t.onSaveCallback(e); t.onSaveCallback(e);
}); });
}; };
spreadsheet_api.prototype.asc_Print = function(adjustPrint, bIsDownloadEvent) { spreadsheet_api.prototype.asc_Print = function(adjustPrint, bIsDownloadEvent) {
if (window["AscDesktopEditor"]) { if (window["AscDesktopEditor"]) {
...@@ -1180,25 +1181,29 @@ var editor; ...@@ -1180,25 +1181,29 @@ var editor;
t.collaborativeEditing._recalcLockArray(c_oAscLockTypes.kLockTypeOther, oRecalcIndexColumns, oRecalcIndexRows); t.collaborativeEditing._recalcLockArray(c_oAscLockTypes.kLockTypeOther, oRecalcIndexColumns, oRecalcIndexRows);
} }
}; };
this.CoAuthoringApi.onStartCoAuthoring = function(isStartEvent) { this.CoAuthoringApi.onStartCoAuthoring = function (isStartEvent) {
t.startCollaborationEditing(); // На старте не нужно ничего делать
if (isStartEvent) {
// На старте не нужно ничего делать t.startCollaborationEditing();
if (!isStartEvent) { } else {
// Когда документ еще не загружен, нужно отпустить lock (при быстром открытии 2-мя пользователями) // Когда документ еще не загружен, нужно отпустить lock (при быстром открытии 2-мя пользователями)
if (!t.IsSendDocumentLoadCompleate) { if (!t.IsSendDocumentLoadCompleate) {
t.CoAuthoringApi.unLockDocument(false); t.startCollaborationEditing();
} else { t.CoAuthoringApi.unLockDocument(false);
// Принимаем чужие изменения } else {
t.collaborativeEditing.applyChanges(); // Сохранять теперь должны на таймере автосохранения. Иначе могли два раза запустить сохранение, не дожидаясь окончания
// Пересылаем свои изменения t.canUnlockDocument = true;
t.collaborativeEditing.sendChanges(); t.canStartCoAuthoring = true;
} }
} }
}; };
this.CoAuthoringApi.onEndCoAuthoring = function(isStartEvent) { this.CoAuthoringApi.onEndCoAuthoring = function (isStartEvent) {
t.endCollaborationEditing(); if (t.canUnlockDocument) {
}; t.canStartCoAuthoring = false;
} else {
t.endCollaborationEditing();
}
};
}; };
spreadsheet_api.prototype._onSaveChanges = function(recalcIndexColumns, recalcIndexRows) { spreadsheet_api.prototype._onSaveChanges = function(recalcIndexColumns, recalcIndexRows) {
...@@ -1213,11 +1218,12 @@ var editor; ...@@ -1213,11 +1218,12 @@ var editor;
} }
} }
if (0 < arrChanges.length || null !== deleteIndex || null !== excelAdditionalInfo) { if (0 < arrChanges.length || null !== deleteIndex || null !== excelAdditionalInfo) {
this.CoAuthoringApi.saveChanges(arrChanges, deleteIndex, excelAdditionalInfo); this.CoAuthoringApi.saveChanges(arrChanges, deleteIndex, excelAdditionalInfo, this.canUnlockDocument2);
History.CanNotAddChanges = true; History.CanNotAddChanges = true;
} else { } else {
this.CoAuthoringApi.unLockDocument(true); this.CoAuthoringApi.unLockDocument(true, this.canUnlockDocument2);
} }
this.canUnlockDocument2 = false;
} }
}; };
...@@ -1430,6 +1436,13 @@ var editor; ...@@ -1430,6 +1436,13 @@ var editor;
this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save); this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
} }
this.canUnlockDocument2 = this.canUnlockDocument;
if (this.canUnlockDocument && this.canStartCoAuthoring) {
this.CoAuthoringApi.onStartCoAuthoring(true);
this.canStartCoAuthoring = false;
this.canUnlockDocument = false;
}
AscCommon.CollaborativeEditing.Clear_CollaborativeMarks(); AscCommon.CollaborativeEditing.Clear_CollaborativeMarks();
// Принимаем чужие изменения // Принимаем чужие изменения
this.collaborativeEditing.applyChanges(); this.collaborativeEditing.applyChanges();
...@@ -1454,8 +1467,6 @@ var editor; ...@@ -1454,8 +1467,6 @@ var editor;
window["AscDesktopEditor"]["OnSave"](); window["AscDesktopEditor"]["OnSave"]();
} }
}; };
// Пересылаем всегда, но чистим только если началось совместное редактирование
// Пересылаем свои изменения // Пересылаем свои изменения
this.collaborativeEditing.sendChanges(this.IsUserSave); this.collaborativeEditing.sendChanges(this.IsUserSave);
} else { } else {
...@@ -2950,11 +2961,17 @@ var editor; ...@@ -2950,11 +2961,17 @@ var editor;
////////////////////////////AutoSave api///////////////////////////////// ////////////////////////////AutoSave api/////////////////////////////////
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
spreadsheet_api.prototype._autoSave = function() { spreadsheet_api.prototype._autoSave = function() {
if ((0 === this.autoSaveGap && (!this.collaborativeEditing.getFast() || !this.collaborativeEditing.getCollaborativeEditing())) if ((!this.canUnlockDocument && 0 === this.autoSaveGap && (!this.collaborativeEditing.getFast() || !this.collaborativeEditing.getCollaborativeEditing()))
|| this.asc_getCellEditMode() || this.asc_getIsTrackShape() || this.isOpenedChartFrame || || this.asc_getCellEditMode() || this.asc_getIsTrackShape() || this.isOpenedChartFrame ||
!History.IsEndTransaction() || !this.canSave) { !History.IsEndTransaction() || !this.canSave) {
return; return;
} }
if (this.canUnlockDocument) {
this.asc_Save(true);
return;
}
if (!History.Have_Changes(true) && !(this.collaborativeEditing.getCollaborativeEditing() && 0 !== this.collaborativeEditing.getOwnLocksLength())) { if (!History.Have_Changes(true) && !(this.collaborativeEditing.getCollaborativeEditing() && 0 !== this.collaborativeEditing.getOwnLocksLength())) {
if (this.collaborativeEditing.getFast() && this.collaborativeEditing.haveOtherChanges()) { if (this.collaborativeEditing.getFast() && this.collaborativeEditing.haveOtherChanges()) {
AscCommon.CollaborativeEditing.Clear_CollaborativeMarks(); AscCommon.CollaborativeEditing.Clear_CollaborativeMarks();
......
...@@ -278,15 +278,17 @@ ...@@ -278,15 +278,17 @@
} }
}; };
CDocsCoApi.prototype.saveChanges = function(arrayChanges, deleteIndex, excelAdditionalInfo) { CDocsCoApi.prototype.saveChanges = function(arrayChanges, deleteIndex, excelAdditionalInfo, canUnlockDocument) {
if (this._CoAuthoringApi && this._onlineWork) { if (this._CoAuthoringApi && this._onlineWork) {
this._CoAuthoringApi.canUnlockDocument = canUnlockDocument;
this._CoAuthoringApi.saveChanges(arrayChanges, null, deleteIndex, excelAdditionalInfo); this._CoAuthoringApi.saveChanges(arrayChanges, null, deleteIndex, excelAdditionalInfo);
} }
}; };
CDocsCoApi.prototype.unLockDocument = function(isSave) { CDocsCoApi.prototype.unLockDocument = function(isSave, canUnlockDocument) {
if (this._CoAuthoringApi && this._onlineWork) { if (this._CoAuthoringApi && this._onlineWork) {
this._CoAuthoringApi.unLockDocument(isSave); this._CoAuthoringApi.canUnlockDocument = canUnlockDocument;
this._CoAuthoringApi.unLockDocument(isSave, canUnlockDocument);
} }
}; };
...@@ -561,6 +563,8 @@ ...@@ -561,6 +563,8 @@
this.changesIndex = 0; this.changesIndex = 0;
// Дополнительная информация для Excel // Дополнительная информация для Excel
this.excelAdditionalInfo = null; this.excelAdditionalInfo = null;
// Unlock document
this.canUnlockDocument = false;
this._url = ""; this._url = "";
...@@ -796,11 +800,12 @@ ...@@ -796,11 +800,12 @@
this._send({'type': 'saveChanges', 'changes': JSON.stringify(arrayChanges.slice(startIndex, endIndex)), this._send({'type': 'saveChanges', 'changes': JSON.stringify(arrayChanges.slice(startIndex, endIndex)),
'startSaveChanges': (startIndex === 0), 'endSaveChanges': (endIndex === arrayChanges.length), 'startSaveChanges': (startIndex === 0), 'endSaveChanges': (endIndex === arrayChanges.length),
'isCoAuthoring': this.isCoAuthoring, 'isExcel': this._isExcel, 'deleteIndex': this.deleteIndex, 'isCoAuthoring': this.isCoAuthoring, 'isExcel': this._isExcel, 'deleteIndex': this.deleteIndex,
'excelAdditionalInfo': this.excelAdditionalInfo ? JSON.stringify(this.excelAdditionalInfo) : null}); 'excelAdditionalInfo': this.excelAdditionalInfo ? JSON.stringify(this.excelAdditionalInfo) : null,
'unlock': this.canUnlockDocument});
}; };
DocsCoApi.prototype.unLockDocument = function(isSave) { DocsCoApi.prototype.unLockDocument = function(isSave) {
this._send({'type': 'unLockDocument', 'isSave': isSave}); this._send({'type': 'unLockDocument', 'isSave': isSave, 'unlock': this.canUnlockDocument});
}; };
DocsCoApi.prototype.getUsers = function() { DocsCoApi.prototype.getUsers = function() {
...@@ -891,13 +896,13 @@ ...@@ -891,13 +896,13 @@
}; };
DocsCoApi.prototype._onMessages = function(data, clear) { DocsCoApi.prototype._onMessages = function(data, clear) {
if (data["messages"] && this.onMessage) { if (ConnectionState.Authorized === this._state && data["messages"] && this.onMessage) {
this.onMessage(data["messages"], clear); this.onMessage(data["messages"], clear);
} }
}; };
DocsCoApi.prototype._onCursor = function(data) { DocsCoApi.prototype._onCursor = function(data) {
if (data["messages"] && this.onCursor) { if (ConnectionState.Authorized === this._state && data["messages"] && this.onCursor) {
this.onCursor(data["messages"]); this.onCursor(data["messages"]);
} }
}; };
...@@ -909,7 +914,7 @@ ...@@ -909,7 +914,7 @@
}; };
DocsCoApi.prototype._onSession = function(data) { DocsCoApi.prototype._onSession = function(data) {
if (data["messages"] && this.onSession) { if (ConnectionState.Authorized === this._state && data["messages"] && this.onSession) {
this.onSession(data["messages"]); this.onSession(data["messages"]);
} }
}; };
...@@ -940,7 +945,7 @@ ...@@ -940,7 +945,7 @@
}; };
DocsCoApi.prototype._onGetLock = function(data) { DocsCoApi.prototype._onGetLock = function(data) {
if (data["locks"]) { if (ConnectionState.Authorized === this._state && data["locks"]) {
for (var key in data["locks"]) { for (var key in data["locks"]) {
if (data["locks"].hasOwnProperty(key)) { if (data["locks"].hasOwnProperty(key)) {
var lock = data["locks"][key], blockTmp = (this._isExcel || this._isPresentation) ? lock["block"]["guid"] : key, blockValue = (this._isExcel || this._isPresentation) ? lock["block"] : key; var lock = data["locks"][key], blockTmp = (this._isExcel || this._isPresentation) ? lock["block"]["guid"] : key, blockValue = (this._isExcel || this._isPresentation) ? lock["block"] : key;
...@@ -978,7 +983,7 @@ ...@@ -978,7 +983,7 @@
}; };
DocsCoApi.prototype._onReleaseLock = function(data) { DocsCoApi.prototype._onReleaseLock = function(data) {
if (data["locks"]) { if (ConnectionState.Authorized === this._state && data["locks"]) {
var bSendEnd = false; var bSendEnd = false;
for (var block in data["locks"]) { for (var block in data["locks"]) {
if (data["locks"].hasOwnProperty(block)) { if (data["locks"].hasOwnProperty(block)) {
...@@ -1004,6 +1009,9 @@ ...@@ -1004,6 +1009,9 @@
}; };
DocsCoApi.prototype._onSaveChanges = function(data) { DocsCoApi.prototype._onSaveChanges = function(data) {
if (ConnectionState.Authorized !== this._state) {
return;
}
if (data["locks"]) { if (data["locks"]) {
var bSendEnd = false; var bSendEnd = false;
for (var block in data["locks"]) { for (var block in data["locks"]) {
...@@ -1196,6 +1204,9 @@ ...@@ -1196,6 +1204,9 @@
}; };
DocsCoApi.prototype._onConnectionStateChanged = function(data) { DocsCoApi.prototype._onConnectionStateChanged = function(data) {
if (ConnectionState.Authorized !== this._state) {
return;
}
var userStateChanged = null, userId, stateChanged = false, isEditUser = true; var userStateChanged = null, userId, stateChanged = false, isEditUser = true;
if (this.onConnectionStateChanged) { if (this.onConnectionStateChanged) {
userStateChanged = new AscCommon.asc_CUser(data['user']); userStateChanged = new AscCommon.asc_CUser(data['user']);
......
...@@ -176,10 +176,11 @@ CCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalIn ...@@ -176,10 +176,11 @@ CCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalIn
this.m_aNeedUnlock2.length = 0; this.m_aNeedUnlock2.length = 0;
if (0 < aChanges.length || null !== deleteIndex) { if (0 < aChanges.length || null !== deleteIndex) {
editor.CoAuthoringApi.saveChanges(aChanges, deleteIndex, AdditionalInfo); editor.CoAuthoringApi.saveChanges(aChanges, deleteIndex, AdditionalInfo, editor.canUnlockDocument2);
AscCommon.History.CanNotAddChanges = true; AscCommon.History.CanNotAddChanges = true;
} else } else
editor.CoAuthoringApi.unLockDocument(true); editor.CoAuthoringApi.unLockDocument(true, editor.canUnlockDocument2);
editor.canUnlockDocument2 = false;
if ( -1 === this.m_nUseType ) if ( -1 === this.m_nUseType )
{ {
......
...@@ -960,26 +960,23 @@ ...@@ -960,26 +960,23 @@
}; };
this.CoAuthoringApi.onStartCoAuthoring = function(isStartEvent) this.CoAuthoringApi.onStartCoAuthoring = function(isStartEvent)
{ {
if (t.ParcedDocument) if (t.ParcedDocument) {
{ if (isStartEvent) {
AscCommon.CollaborativeEditing.Start_CollaborationEditing(); AscCommon.CollaborativeEditing.Start_CollaborationEditing();
t.WordControl.m_oLogicDocument.DrawingDocument.Start_CollaborationEditing(); t.asc_setDrawCollaborationMarks(true);
t.WordControl.m_oLogicDocument.DrawingDocument.Start_CollaborationEditing();
if (true != History.Is_Clear()) } else {
{ // Сохранять теперь должны на таймере автосохранения. Иначе могли два раза запустить сохранение, не дожидаясь окончания
AscCommon.CollaborativeEditing.Apply_Changes(); t.canUnlockDocument = true;
AscCommon.CollaborativeEditing.Send_Changes(); t.canStartCoAuthoring = true;
} }
else } else {
{ t.isStartCoAuthoringOnEndLoad = true;
// Изменений нет, но нужно сбросить lock if (!isStartEvent) {
// Документ еще не подгрузился, но нужно сбросить lock
t.CoAuthoringApi.unLockDocument(false); t.CoAuthoringApi.unLockDocument(false);
} }
} }
else
{
t.isStartCoAuthoringOnEndLoad = true;
}
}; };
this.CoAuthoringApi.onEndCoAuthoring = function(isStartEvent) this.CoAuthoringApi.onEndCoAuthoring = function(isStartEvent)
{ {
...@@ -1832,6 +1829,13 @@ background-repeat: no-repeat;\ ...@@ -1832,6 +1829,13 @@ background-repeat: no-repeat;\
} }
this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save); this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
this.canUnlockDocument2 = this.canUnlockDocument;
if (this.canUnlockDocument && this.canStartCoAuthoring) {
this.CoAuthoringApi.onStartCoAuthoring(true);
this.canStartCoAuthoring = false;
this.canUnlockDocument = false;
}
if (c_oAscCollaborativeMarksShowType.LastChanges === this.CollaborativeMarksShowType) if (c_oAscCollaborativeMarksShowType.LastChanges === this.CollaborativeMarksShowType)
{ {
AscCommon.CollaborativeEditing.Clear_CollaborativeMarks(); AscCommon.CollaborativeEditing.Clear_CollaborativeMarks();
...@@ -1930,7 +1934,7 @@ background-repeat: no-repeat;\ ...@@ -1930,7 +1934,7 @@ background-repeat: no-repeat;\
{ {
this.IsUserSave = !isAutoSave; this.IsUserSave = !isAutoSave;
if (true === this.canSave && !this.isLongAction() && (this.asc_isDocumentCanSave() || History.Have_Changes() || if (true === this.canSave && !this.isLongAction() && (this.asc_isDocumentCanSave() || History.Have_Changes() ||
AscCommon.CollaborativeEditing.Have_OtherChanges())) AscCommon.CollaborativeEditing.Have_OtherChanges() || this.canUnlockDocument))
{ {
this.canSave = false; this.canSave = false;
...@@ -5863,6 +5867,9 @@ background-repeat: no-repeat;\ ...@@ -5863,6 +5867,9 @@ background-repeat: no-repeat;\
{ {
this.sendEvent("asc_onCloseChartEditor"); this.sendEvent("asc_onCloseChartEditor");
}; };
asc_docs_api.prototype.asc_setDrawCollaborationMarks = function()
{
};
//----------------------------------------------------------------- //-----------------------------------------------------------------
// События контекстного меню // События контекстного меню
......
...@@ -127,13 +127,14 @@ CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, Addition ...@@ -127,13 +127,14 @@ CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, Addition
if (0 < aChanges.length || null !== deleteIndex) if (0 < aChanges.length || null !== deleteIndex)
{ {
this.private_OnSendOwnChanges(aChanges2, deleteIndex); this.private_OnSendOwnChanges(aChanges2, deleteIndex);
editor.CoAuthoringApi.saveChanges(aChanges, deleteIndex, AdditionalInfo); editor.CoAuthoringApi.saveChanges(aChanges, deleteIndex, AdditionalInfo, editor.canUnlockDocument2);
AscCommon.History.CanNotAddChanges = true; AscCommon.History.CanNotAddChanges = true;
} }
else else
{ {
editor.CoAuthoringApi.unLockDocument(true); editor.CoAuthoringApi.unLockDocument(true, editor.canUnlockDocument2);
} }
editor.canUnlockDocument2 = false;
if (-1 === this.m_nUseType) if (-1 === this.m_nUseType)
{ {
......
...@@ -1182,32 +1182,19 @@ background-repeat: no-repeat;\ ...@@ -1182,32 +1182,19 @@ background-repeat: no-repeat;\
}; };
this.CoAuthoringApi.onStartCoAuthoring = function(isStartEvent) this.CoAuthoringApi.onStartCoAuthoring = function(isStartEvent)
{ {
AscCommon.CollaborativeEditing.Start_CollaborationEditing(); if (t.ParcedDocument) {
t.asc_setDrawCollaborationMarks(true); if (isStartEvent) {
AscCommon.CollaborativeEditing.Start_CollaborationEditing();
if (t.ParcedDocument) t.asc_setDrawCollaborationMarks(true);
{ t.WordControl.m_oLogicDocument.DrawingDocument.Start_CollaborationEditing();
t.WordControl.m_oLogicDocument.DrawingDocument.Start_CollaborationEditing(); } else {
// Сохранять теперь должны на таймере автосохранения. Иначе могли два раза запустить сохранение, не дожидаясь окончания
if (!isStartEvent) t.canUnlockDocument = true;
{ t.canStartCoAuthoring = true;
if (true != History.Is_Clear())
{
AscCommon.CollaborativeEditing.Apply_Changes();
AscCommon.CollaborativeEditing.Send_Changes();
}
else
{
// Изменений нет, но нужно сбросить lock
t.CoAuthoringApi.unLockDocument(true);
}
} }
} } else {
else
{
t.isStartCoAuthoringOnEndLoad = true; t.isStartCoAuthoringOnEndLoad = true;
if (!isStartEvent) if (!isStartEvent) {
{
// Документ еще не подгрузился, но нужно сбросить lock // Документ еще не подгрузился, но нужно сбросить lock
t.CoAuthoringApi.unLockDocument(false); t.CoAuthoringApi.unLockDocument(false);
} }
...@@ -1215,8 +1202,12 @@ background-repeat: no-repeat;\ ...@@ -1215,8 +1202,12 @@ background-repeat: no-repeat;\
}; };
this.CoAuthoringApi.onEndCoAuthoring = function(isStartEvent) this.CoAuthoringApi.onEndCoAuthoring = function(isStartEvent)
{ {
AscCommon.CollaborativeEditing.End_CollaborationEditing(); if (t.canUnlockDocument) {
t.asc_setDrawCollaborationMarks(false); t.canStartCoAuthoring = false;
} else {
AscCommon.CollaborativeEditing.End_CollaborationEditing();
t.asc_setDrawCollaborationMarks(false);
}
}; };
}; };
...@@ -1801,6 +1792,13 @@ background-repeat: no-repeat;\ ...@@ -1801,6 +1792,13 @@ background-repeat: no-repeat;\
} }
this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save); this.sync_StartAction(c_oAscAsyncActionType.Information, c_oAscAsyncAction.Save);
this.canUnlockDocument2 = this.canUnlockDocument;
if (this.canUnlockDocument && this.canStartCoAuthoring) {
this.CoAuthoringApi.onStartCoAuthoring(true);
this.canStartCoAuthoring = false;
this.canUnlockDocument = false;
}
if (c_oAscCollaborativeMarksShowType.LastChanges === this.CollaborativeMarksShowType) if (c_oAscCollaborativeMarksShowType.LastChanges === this.CollaborativeMarksShowType)
{ {
AscCommon.CollaborativeEditing.Clear_CollaborativeMarks(); AscCommon.CollaborativeEditing.Clear_CollaborativeMarks();
...@@ -1908,7 +1906,7 @@ background-repeat: no-repeat;\ ...@@ -1908,7 +1906,7 @@ background-repeat: no-repeat;\
{ {
this.IsUserSave = !isAutoSave; this.IsUserSave = !isAutoSave;
if (true === this.canSave && !this.isLongAction() && (this.asc_isDocumentCanSave() || History.Have_Changes() || if (true === this.canSave && !this.isLongAction() && (this.asc_isDocumentCanSave() || History.Have_Changes() ||
AscCommon.CollaborativeEditing.Have_OtherChanges() || true === isUndoRequest)) AscCommon.CollaborativeEditing.Have_OtherChanges() || true === isUndoRequest || this.canUnlockDocument))
{ {
this.canSave = false; this.canSave = 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