Commit 2f7f8d4c authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

fix bug #28654

При восстановлении соединения не было проверки на возможность редактирования (была неправильной проверка "сохранил ли кто-нибудь, пока не было соединения")

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61433 954022d7-b5bf-4e40-9824-e11837661b57
parent 31c0dfa3
...@@ -271,7 +271,7 @@ ...@@ -271,7 +271,7 @@
this._saveCallback = []; this._saveCallback = [];
this.saveLockCallbackErrorTimeOutId = null; this.saveLockCallbackErrorTimeOutId = null;
this.saveCallbackErrorTimeOutId = null; this.saveCallbackErrorTimeOutId = null;
this._id = ""; this._id = null;
this._indexuser = -1; this._indexuser = -1;
// Если пользователей больше 1, то совместно редактируем // Если пользователей больше 1, то совместно редактируем
this.isCoAuthoring = false; this.isCoAuthoring = false;
...@@ -668,11 +668,13 @@ ...@@ -668,11 +668,13 @@
}; };
DocsCoApi.prototype._checkSaveChangesInDisconnect = function (allServerChanges) { DocsCoApi.prototype._checkSaveChangesInDisconnect = function (allServerChanges) {
for (var changeId in allServerChanges) { if (0 < allServerChanges.length) {
var change = allServerChanges[changeId]; var change = allServerChanges[allServerChanges.length - 1];
var changesOneUser = change["changes"]; var changesOneUser = change['change'];
if (changesOneUser && change["user"] !== this._userId && this.lastOtherSaveTime !== change["time"]) if (changesOneUser) {
return true; if (change['user'] !== this._userId)
return this.lastOtherSaveTime !== change['time'];
}
} }
return false; return false;
}; };
...@@ -681,13 +683,13 @@ ...@@ -681,13 +683,13 @@
if (this.onSaveChanges) { if (this.onSaveChanges) {
this.changesIndex = changesIndex; this.changesIndex = changesIndex;
if (allServerChanges) { if (allServerChanges) {
for (var changeId in allServerChanges) { for (var i = 0; i < allServerChanges.length; ++i) {
var change = allServerChanges[changeId]; var change = allServerChanges[i];
var changesOneUser = change["change"]; var changesOneUser = change['change'];
if (changesOneUser) { if (changesOneUser) {
if (change["user"] !== this._userId) if (change['user'] !== this._userId)
this.lastOtherSaveTime = change["time"]; this.lastOtherSaveTime = change['time'];
this.onSaveChanges(JSON.parse(changesOneUser), change["user"], bFirstLoad); this.onSaveChanges(JSON.parse(changesOneUser), change['user'], bFirstLoad);
} }
} }
} }
......
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