Commit 01b16273 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Поправил опериции при lock

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57708 954022d7-b5bf-4e40-9824-e11837661b57
parent c2ec1add
......@@ -1503,33 +1503,29 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.CoAuthoringApi.onLocksAcquired = function (e) {
if (2 != e["state"]) {
var elementValue = e["blockValue"];
var lockElem = t.collaborativeEditing.getLockByElem (elementValue, c_oAscLockTypes.kLockTypeOther);
var lockElem = t.collaborativeEditing.getLockByElem(elementValue, c_oAscLockTypes.kLockTypeOther);
if (null === lockElem) {
lockElem = new asc.CLock (elementValue);
t.collaborativeEditing.addUnlock (lockElem);
lockElem = new asc.CLock(elementValue);
t.collaborativeEditing.addUnlock(lockElem);
}
var drawing;
if (null != lockElem) {
var oldType = lockElem.getType();
if (c_oAscLockTypes.kLockTypeOther2 === oldType || c_oAscLockTypes.kLockTypeOther3 === oldType)
lockElem.setType (c_oAscLockTypes.kLockTypeOther3, true);
lockElem.setType(c_oAscLockTypes.kLockTypeOther3, true);
else
lockElem.setType (c_oAscLockTypes.kLockTypeOther, true);
lockElem.setType(c_oAscLockTypes.kLockTypeOther, true);
// Выставляем ID пользователя, залочившего данный элемент
lockElem.setUserId (e["user"]);
lockElem.setUserId(e["user"]);
if(lockElem && lockElem.Element)
{
if (lockElem.Element["type"] === c_oAscLockTypeElem.Object) {
drawing = g_oTableId.Get_ById(lockElem.Element["rangeOrObjectId"]);
if(drawing)
{
if (drawing)
drawing.lockType = lockElem.Type;
}
}
}
if (t.wb) {
// Шлем update для toolbar-а, т.к. когда select в lock ячейке нужно заблокировать toolbar
......@@ -1545,12 +1541,11 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
ws.draw();
else
ws.updateSelection();
if(drawing && ws.model === drawing.worksheet)
{
if (drawing && ws.model === drawing.worksheet)
ws.objectRender.showDrawingObjects(true);
}
}
}
};
this.CoAuthoringApi.onLocksReleased = function (e, bChanges) {
var element = e["block"];
......@@ -1581,9 +1576,9 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
else {
// Удаляем из lock-ов, тот, кто правил ушел и не сохранил
t.collaborativeEditing.removeUnlock (lockElem);
if (lockElem.Element["type"] === c_oAscLockTypeElem.Object) {
drawing = g_oTableId.Get_ById(lockElem.Element["rangeOrObjectId"]);
if(drawing && drawing.lockType !== c_oAscLockTypes.kLockTypeNone)
{
if (drawing)
drawing.lockType = c_oAscLockTypes.kLockTypeNone;
}
}
......
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