Commit 7506db48 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@62242 954022d7-b5bf-4e40-9824-e11837661b57
parent 98d400fe
......@@ -67,6 +67,7 @@
"../../Excel/model/History.js",
"../../Excel/model/UndoRedo.js",
"../../Excel/model/CellComment.js",
"../../Excel/model/Private/CellComment.js",
"../../Excel/view/mobileTouch.js",
"../../Excel/view/iscroll.js",
"../../Excel/view/PopUpSelector.js",
......@@ -74,6 +75,7 @@
"../../Excel/view/CellTextRender.js",
"../../Excel/view/CellEditorView.js",
"../../Excel/view/WorksheetView.js",
"../../Excel/view/Private/WorksheetView.js",
"../../Excel/view/HandlerList.js",
"../../Excel/view/EventsController.js",
"../../Excel/view/WorkbookView.js",
......@@ -158,7 +160,8 @@
"../../Excel/model/DrawingObjects/GlobalCounters.js",
"../../Word/apiCommon.js",
"../../Excel/Build/Log/apiCommonExport.js",
"../../Excel/api.js"
"../../Excel/api.js",
"../../Excel/Private/api.js"
],
"dst": "../../Excel/sdk-all.js",
"externs": [
......@@ -200,12 +203,14 @@
"cwd": "../../Excel/",
"src": [
"api.js",
"Private/api.js",
"apiDefines.js",
"view/EventsController.js",
"view/HandlerList.js",
"model/AdvancedOptions.js",
"model/CellInfo.js",
"model/CellComment.js",
"model/Private/CellComment.js",
"utils/utils.js",
"css/*.css"
],
......
......@@ -144,6 +144,7 @@
"../../Word/Math/borderBox.js",
"../../Excel/utils/utils.js",
"../../Excel/model/CellComment.js",
"../../Excel/model/Private/CellComment.js",
"../../Excel/model/Serialize.js",
"../../Excel/model/WorkbookElems.js",
"../../Excel/model/Workbook.js",
......
......@@ -71,6 +71,7 @@
<script type="text/javascript" src="../model/FormulaObjects/informationFunctions.js"></script>
<script type="text/javascript" src="../model/FormulaObjects/logicalFunctions.js"></script>
<script type="text/javascript" src="../model/CellComment.js"></script>
<script type="text/javascript" src="../model/Private/CellComment.js"></script>
<script type="text/javascript" src="../../Common/NumFormat.js"></script>
<script type="text/javascript" src="../model/Serialize.js"></script>
<script type="text/javascript" src="../model/WorkbookElems.js"></script>
......@@ -87,11 +88,13 @@
<script type="text/javascript" src="../view/CellTextRender.js"></script>
<script type="text/javascript" src="../view/CellEditorView.js"></script>
<script type="text/javascript" src="../view/WorksheetView.js"></script>
<script type="text/javascript" src="../view/Private/WorksheetView.js"></script>
<script type="text/javascript" src="../view/HandlerList.js"></script>
<script type="text/javascript" src="../view/EventsController.js"></script>
<script type="text/javascript" src="../view/WorkbookView.js"></script>
<script type="text/javascript" src="../api.js"></script>
<script type="text/javascript" src="../Private/api.js"></script>
<!--for theme-->
<script type="text/javascript" src="../../Common/Shapes/EditorSettings.js"></script>
......
"use strict";
/* api.js
*
* Author: Alexander.Trofimov@avsmedia.net
* Date: Apr 23, 2015
*/
(
/**
* @param {jQuery} $
* @param {Window} window
* @param {undefined} undefined
*/
function ($, window, undefined) {
var asc = window["Asc"];
var asc_applyFunction = asc.applyFunction;
asc.spreadsheet_api.prototype._getIsLockObjectSheet = function (lockInfo, callback) {
if (false === this.collaborativeEditing.isCoAuthoringExcellEnable()) {
// Запрещено совместное редактирование
asc_applyFunction(callback, true);
return;
}
if (false === this.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
asc_applyFunction(callback, true);
callback = undefined;
}
if (false !== this.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeMine, /*bCheckOnlyLockAll*/false)) {
// Редактируем сами
asc_applyFunction(callback, true);
return;
} else if (false !== this.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeOther, /*bCheckOnlyLockAll*/false)) {
// Уже ячейку кто-то редактирует
asc_applyFunction(callback, false);
return;
}
this.collaborativeEditing.onStartCheckLock();
this.collaborativeEditing.addCheckLock(lockInfo);
this.collaborativeEditing.onEndCheckLock(callback);
};
// Залочена ли панель для закрепления
asc.spreadsheet_api.prototype._isLockedTabColor = function (index, callback) {
if (false === this.collaborativeEditing.isCoAuthoringExcellEnable()) {
// Запрещено совместное редактирование
asc_applyFunction(callback, true);
return;
}
var sheetId = this.wbModel.getWorksheet(index).getId();
var lockInfo = this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null, sheetId, c_oAscLockNameTabColor);
if (false === this.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
asc_applyFunction(callback, true);
callback = undefined;
}
if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeMine, /*bCheckOnlyLockAll*/false)) {
// Редактируем сами
asc_applyFunction(callback, true);
return;
} else if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeOther, /*bCheckOnlyLockAll*/false)) {
// Уже ячейку кто-то редактирует
asc_applyFunction(callback, false);
return;
}
this.collaborativeEditing.onStartCheckLock();
this.collaborativeEditing.addCheckLock(lockInfo);
this.collaborativeEditing.onEndCheckLock(callback);
};
}
)(jQuery, window);
......@@ -90,6 +90,7 @@
<script type="text/javascript" src="model/FormulaObjects/informationFunctions.js"></script>
<script type="text/javascript" src="model/FormulaObjects/logicalFunctions.js"></script>
<script type="text/javascript" src="model/CellComment.js"></script>
<script type="text/javascript" src="model/Private/CellComment.js"></script>
<script type="text/javascript" src="../Common/NumFormat.js"></script>
<script type="text/javascript" src="model/Serialize.js"></script>
<script type="text/javascript" src="model/WorkbookElems.js"></script>
......@@ -106,11 +107,13 @@
<script type="text/javascript" src="view/CellTextRender.js"></script>
<script type="text/javascript" src="view/CellEditorView.js"></script>
<script type="text/javascript" src="view/WorksheetView.js"></script>
<script type="text/javascript" src="view/Private/WorksheetView.js"></script>
<script type="text/javascript" src="view/HandlerList.js"></script>
<script type="text/javascript" src="view/EventsController.js"></script>
<script type="text/javascript" src="view/WorkbookView.js"></script>
<script type="text/javascript" src="api.js"></script>
<script type="text/javascript" src="Private/api.js"></script>
<script type="text/javascript" src="menu/menu.js"></script>
<!--for theme-->
......
......@@ -77,6 +77,7 @@
<script type="text/javascript" src="model/FormulaObjects/informationFunctions.js"></script>
<script type="text/javascript" src="model/FormulaObjects/logicalFunctions.js"></script>
<script type="text/javascript" src="model/CellComment.js"></script>
<script type="text/javascript" src="model/Private/CellComment.js"></script>
<script type="text/javascript" src="../Common/NumFormat.js"></script>
<script type="text/javascript" src="model/Serialize.js"></script>
<script type="text/javascript" src="model/WorkbookElems.js"></script>
......@@ -95,11 +96,13 @@
<script type="text/javascript" src="view/CellTextRender.js"></script>
<script type="text/javascript" src="view/CellEditorView.js"></script>
<script type="text/javascript" src="view/WorksheetView.js"></script>
<script type="text/javascript" src="view/Private/WorksheetView.js"></script>
<script type="text/javascript" src="view/HandlerList.js"></script>
<script type="text/javascript" src="view/EventsController.js"></script>
<script type="text/javascript" src="view/WorkbookView.js"></script>
<script type="text/javascript" src="api.js"></script>
<script type="text/javascript" src="Private/api.js"></script>
<!--for theme-->
<script type="text/javascript" src="../Common/Shapes/EditorSettings.js"></script>
......
......@@ -1972,62 +1972,11 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
};
spreadsheet_api.prototype._getIsLockObjectSheet = function (lockInfo, callback) {
if (false === this.collaborativeEditing.isCoAuthoringExcellEnable()) {
// Запрещено совместное редактирование
asc_applyFunction(callback, true);
return;
}
if (false === this.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
asc_applyFunction(callback, true);
callback = undefined;
}
if (false !== this.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeMine, /*bCheckOnlyLockAll*/false)) {
// Редактируем сами
asc_applyFunction(callback, true);
return;
} else if (false !== this.collaborativeEditing.getLockIntersection(lockInfo, c_oAscLockTypes.kLockTypeOther, /*bCheckOnlyLockAll*/false)) {
// Уже ячейку кто-то редактирует
asc_applyFunction(callback, false);
return;
}
this.collaborativeEditing.onStartCheckLock();
this.collaborativeEditing.addCheckLock(lockInfo);
this.collaborativeEditing.onEndCheckLock(callback);
asc_applyFunction(callback, true);
};
// Залочена ли панель для закрепления
spreadsheet_api.prototype._isLockedTabColor = function (index, callback) {
if (false === this.collaborativeEditing.isCoAuthoringExcellEnable()) {
// Запрещено совместное редактирование
asc_applyFunction(callback, true);
return;
}
var sheetId = this.wbModel.getWorksheet(index).getId();
var lockInfo = this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null, sheetId, c_oAscLockNameTabColor);
if (false === this.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
asc_applyFunction(callback, true);
callback = undefined;
}
if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeMine, /*bCheckOnlyLockAll*/false)) {
// Редактируем сами
asc_applyFunction(callback, true);
return;
} else if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeOther, /*bCheckOnlyLockAll*/false)) {
// Уже ячейку кто-то редактирует
asc_applyFunction(callback, false);
return;
}
this.collaborativeEditing.onStartCheckLock();
this.collaborativeEditing.addCheckLock(lockInfo);
this.collaborativeEditing.onEndCheckLock(callback);
asc_applyFunction(callback, true);
};
spreadsheet_api.prototype._addWorksheet = function (name, i) {
......
......@@ -296,6 +296,7 @@
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/FormulaObjects/informationFunctions.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/FormulaObjects/logicalFunctions.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/CellComment.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/Private/CellComment.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/Serialize.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/WorkbookElems.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/Workbook.js"></script>
......@@ -309,11 +310,13 @@
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/CellTextRender.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/CellEditorView.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/WorksheetView.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/Private/WorksheetView.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/HandlerList.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/EventsController.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/WorkbookView.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/api.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/Private/api.js"></script>
<!--for theme-->
<script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/EditorSettings.js"></script>
......
......@@ -259,6 +259,7 @@
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/FormulaObjects/informationFunctions.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/FormulaObjects/logicalFunctions.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/CellComment.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/Private/CellComment.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/Serialize.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/WorkbookElems.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/Workbook.js"></script>
......@@ -274,11 +275,13 @@
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/CellTextRender.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/CellEditorView.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/WorksheetView.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/Private/WorksheetView.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/HandlerList.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/EventsController.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/view/WorkbookView.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/api.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/Private/api.js"></script>
<!--for theme-->
<script type="text/javascript" src="../../../../OfficeWeb/Common/Shapes/EditorSettings.js"></script>
......
......@@ -460,43 +460,7 @@ CCellCommentator.prototype.isViewerMode = function () {
};
CCellCommentator.prototype.isLockedComment = function(oComment, callbackFunc) {
if (false === this.worksheet.collaborativeEditing.isCoAuthoringExcellEnable()) {
// Запрещено совместное редактирование
Asc.applyFunction(callbackFunc, true);
return;
}
var objectGuid = oComment.asc_getId();
if (objectGuid) {
// Комментарии не должны влиять на lock-листа, поэтому вместо добавления нового c_oAscLockTypeElem, поменяем имя листа
var sheetId = CCellCommentator.sStartCommentId;
if (!oComment.bDocument)
sheetId += this.worksheet.model.getId();
var lockInfo = this.worksheet.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, /*subType*/null,
sheetId, objectGuid);
if (false === this.worksheet.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
Asc.applyFunction(callbackFunc, true);
callbackFunc = undefined;
}
if (false !== this.worksheet.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeMine, /*bCheckOnlyLockAll*/false)) {
// Редактируем сами
Asc.applyFunction(callbackFunc, true);
return;
} else if (false !== this.worksheet.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeOther, /*bCheckOnlyLockAll*/false)) {
// Уже ячейку кто-то редактирует
Asc.applyFunction(callbackFunc, false);
return;
}
this.worksheet.collaborativeEditing.onStartCheckLock();
this.worksheet.collaborativeEditing.addCheckLock(lockInfo);
this.worksheet.collaborativeEditing.onEndCheckLock(callbackFunc);
}
Asc.applyFunction(callbackFunc, true);
};
CCellCommentator.prototype.moveRangeComments = function(rangeFrom, rangeTo) {
......
"use strict";
/* CellComment.js
*
* Author: Alexander.Trofimov@avsmedia.net
* Date: Apr 23, 2015
*/
CCellCommentator.prototype.isLockedComment = function(oComment, callbackFunc) {
if (false === this.worksheet.collaborativeEditing.isCoAuthoringExcellEnable()) {
// Запрещено совместное редактирование
Asc.applyFunction(callbackFunc, true);
return;
}
var objectGuid = oComment.asc_getId();
if (objectGuid) {
// Комментарии не должны влиять на lock-листа, поэтому вместо добавления нового c_oAscLockTypeElem, поменяем имя листа
var sheetId = CCellCommentator.sStartCommentId;
if (!oComment.bDocument)
sheetId += this.worksheet.model.getId();
var lockInfo = this.worksheet.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, /*subType*/null,
sheetId, objectGuid);
if (false === this.worksheet.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
Asc.applyFunction(callbackFunc, true);
callbackFunc = undefined;
}
if (false !== this.worksheet.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeMine, /*bCheckOnlyLockAll*/false)) {
// Редактируем сами
Asc.applyFunction(callbackFunc, true);
return;
} else if (false !== this.worksheet.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeOther, /*bCheckOnlyLockAll*/false)) {
// Уже ячейку кто-то редактирует
Asc.applyFunction(callbackFunc, false);
return;
}
this.worksheet.collaborativeEditing.onStartCheckLock();
this.worksheet.collaborativeEditing.addCheckLock(lockInfo);
this.worksheet.collaborativeEditing.onEndCheckLock(callbackFunc);
}
};
\ No newline at end of file
"use strict";
/* WorksheetView.js
*
* Author: Alexander.Trofimov@avsmedia.net
* Date: Apr 23, 2015
*/
(
/**
* @param {jQuery} $
* @param {Window} window
* @param {undefined} undefined
*/
function ($, window, undefined) {
/*
* Import
* -----------------------------------------------------------------------------
*/
var asc = window["Asc"];
var asc_applyFunction = asc.applyFunction;
// Залочена ли панель для закрепления
asc.WorksheetView.prototype._isLockedFrozenPane = function (callback) {
if (false === this.collaborativeEditing.isCoAuthoringExcellEnable()) {
// Запрещено совместное редактирование
asc_applyFunction(callback, true);
return;
}
var sheetId = this.model.getId();
var lockInfo = this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Object, null, sheetId, c_oAscLockNameFrozenPane);
if (false === this.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
asc_applyFunction(callback, true);
callback = undefined;
}
if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeMine, /*bCheckOnlyLockAll*/false)) {
// Редактируем сами
asc_applyFunction(callback, true);
return;
} else if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeOther, /*bCheckOnlyLockAll*/false)) {
// Уже ячейку кто-то редактирует
asc_applyFunction(callback, false);
return;
}
this.collaborativeEditing.onStartCheckLock();
this.collaborativeEditing.addCheckLock(lockInfo);
this.collaborativeEditing.onEndCheckLock(callback);
};
// Залочен ли весь лист
asc.WorksheetView.prototype.prototype._isLockedAll = function (callback) {
if (false === this.collaborativeEditing.isCoAuthoringExcellEnable()) {
// Запрещено совместное редактирование
asc_applyFunction(callback, true);
return;
}
var sheetId = this.model.getId();
var subType = c_oAscLockTypeElemSubType.ChangeProperties;
var ar = this.activeRange;
var lockInfo = this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Range, /*subType*/subType,
sheetId, new asc.asc_CCollaborativeRange(ar.c1, ar.r1, ar.c2, ar.r2));
if (false === this.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
asc_applyFunction(callback, true);
callback = undefined;
}
if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeMine, /*bCheckOnlyLockAll*/true)) {
// Редактируем сами
asc_applyFunction(callback, true);
return;
} else if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeOther, /*bCheckOnlyLockAll*/true)) {
// Уже ячейку кто-то редактирует
asc_applyFunction(callback, false);
return;
}
this.collaborativeEditing.onStartCheckLock();
this.collaborativeEditing.addCheckLock(lockInfo);
this.collaborativeEditing.onEndCheckLock(callback);
};
// Функция проверки lock (возвращаемый результат нельзя использовать в качестве ответа, он нужен только для редактирования ячейки)
asc.WorksheetView.prototype._isLockedCells = function (range, subType, callback) {
if (false === this.collaborativeEditing.isCoAuthoringExcellEnable()) {
// Запрещено совместное редактирование
asc_applyFunction(callback, true);
return true;
}
var sheetId = this.model.getId();
var isIntersection = false;
var newCallback = callback;
var t = this;
this.collaborativeEditing.onStartCheckLock();
var isArrayRange = Array.isArray(range);
var nLength = isArrayRange ? range.length : 1;
var nIndex = 0;
var ar = null;
for (; nIndex < nLength; ++nIndex) {
ar = isArrayRange ? range[nIndex].clone(true) : range.clone(true);
if (c_oAscLockTypeElemSubType.InsertColumns !== subType && c_oAscLockTypeElemSubType.InsertRows !== subType) {
// Пересчет для входящих ячеек в добавленные строки/столбцы
isIntersection = this._recalcRangeByInsertRowsAndColumns(sheetId, ar);
}
if (false === isIntersection) {
var lockInfo = this.collaborativeEditing.getLockInfo(c_oAscLockTypeElem.Range, /*subType*/subType,
sheetId, new asc.asc_CCollaborativeRange(ar.c1, ar.r1, ar.c2, ar.r2));
if (false !== this.collaborativeEditing.getLockIntersection(lockInfo,
c_oAscLockTypes.kLockTypeOther, /*bCheckOnlyLockAll*/false)) {
// Уже ячейку кто-то редактирует
asc_applyFunction(callback, false);
return false;
} else {
if (c_oAscLockTypeElemSubType.InsertColumns === subType) {
newCallback = function (isSuccess) {
if (isSuccess) {
t.collaborativeEditing.addColsRange(sheetId, range.clone(true));
t.collaborativeEditing.addCols(sheetId, range.c1, range.c2 - range.c1 + 1);
}
callback(isSuccess);
};
} else if (c_oAscLockTypeElemSubType.InsertRows === subType) {
newCallback = function (isSuccess) {
if (isSuccess) {
t.collaborativeEditing.addRowsRange(sheetId, range.clone(true));
t.collaborativeEditing.addRows(sheetId, range.r1, range.r2 - range.r1 + 1);
}
callback(isSuccess);
};
} else if (c_oAscLockTypeElemSubType.DeleteColumns === subType) {
newCallback = function (isSuccess) {
if (isSuccess) {
t.collaborativeEditing.removeColsRange(sheetId, range.clone(true));
t.collaborativeEditing.removeCols(sheetId, range.c1, range.c2 - range.c1 + 1);
}
callback(isSuccess);
};
} else if (c_oAscLockTypeElemSubType.DeleteRows === subType) {
newCallback = function (isSuccess) {
if (isSuccess) {
t.collaborativeEditing.removeRowsRange(sheetId, range.clone(true));
t.collaborativeEditing.removeRows(sheetId, range.r1, range.r2 - range.r1 + 1);
}
callback(isSuccess);
};
}
this.collaborativeEditing.addCheckLock(lockInfo);
}
} else {
if (c_oAscLockTypeElemSubType.InsertColumns === subType) {
t.collaborativeEditing.addColsRange(sheetId, range.clone(true));
t.collaborativeEditing.addCols(sheetId, range.c1, range.c2 - range.c1 + 1);
} else if (c_oAscLockTypeElemSubType.InsertRows === subType) {
t.collaborativeEditing.addRowsRange(sheetId, range.clone(true));
t.collaborativeEditing.addRows(sheetId, range.r1, range.r2 - range.r1 + 1);
} else if (c_oAscLockTypeElemSubType.DeleteColumns === subType) {
t.collaborativeEditing.removeColsRange(sheetId, range.clone(true));
t.collaborativeEditing.removeCols(sheetId, range.c1, range.c2 - range.c1 + 1);
} else if (c_oAscLockTypeElemSubType.DeleteRows === subType) {
t.collaborativeEditing.removeRowsRange(sheetId, range.clone(true));
t.collaborativeEditing.removeRows(sheetId, range.r1, range.r2 - range.r1 + 1);
}
}
}
if (false === this.collaborativeEditing.getCollaborativeEditing()) {
// Пользователь редактирует один: не ждем ответа, а сразу продолжаем редактирование
newCallback(true);
newCallback = undefined;
}
this.collaborativeEditing.onEndCheckLock(newCallback);
return true;
};
}
)(jQuery, window);
This diff is collapsed.
......@@ -209,6 +209,7 @@
<script type="text/javascript" src="../Excel/utils/utils.js"></script>
<script type="text/javascript" src="../Excel/model/CellComment.js"></script>
<script type="text/javascript" src="../Excel/model/Private/CellComment.js"></script>
<script type="text/javascript" src="../Excel/model/Serialize.js"></script>
<script type="text/javascript" src="../Excel/model/WorkbookElems.js"></script>
<script type="text/javascript" src="../Excel/model/Workbook.js"></script>
......
......@@ -403,6 +403,7 @@
<script type="text/javascript" src="../../../../OfficeWeb/Excel/utils/utils.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/CellComment.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/Private/CellComment.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/Serialize.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/WorkbookElems.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Excel/model/Workbook.js"></script>
......
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