Commit 1be42c3f authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Немного переделана схема отрисовки флага, с учетом будущих изменений в меню....

Немного переделана схема отрисовки флага, с учетом будущих изменений в меню. Теперь флаг и курсор будут идеально прилегать друг к другу. Исправлена проблема со скроллом.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66168 954022d7-b5bf-4e40-9824-e11837661b57
parent 2076e3cc
......@@ -2244,6 +2244,9 @@ CDrawingCollaborativeTarget.prototype =
}
}
if (CollaborativeEditing)
CollaborativeEditing.Update_ForeignCursorLabelPosition(this.Id, this.HtmlElementX, this.HtmlElementY, this.Color);
// 3) добавить, если нужно
if (bIsHtmlElementCreate)
{
......@@ -6962,6 +6965,17 @@ function CDrawingDocument()
return null;
};
this.Collaborative_GetTargetPosition = function(UserId)
{
for (var i = 0; i < this.CollaborativeTargets.length; i++)
{
if (UserId == this.CollaborativeTargets[i].Id)
return {X : this.CollaborativeTargets[i].HtmlElementX, Y : this.CollaborativeTargets[i].HtmlElementY};
}
return null;
};
}
function CStyleImage(_name, _ind, _type, _uiPriority)
......
......@@ -6,6 +6,8 @@
* Time: 12:01
*/
var FOREIGN_CURSOR_LABEL_HIDETIME = 1500;
function CWordCollaborativeEditing()
{
CWordCollaborativeEditing.superclass.constructor.call(this);
......@@ -418,13 +420,6 @@ CWordCollaborativeEditing.prototype.Show_ForeignCursorLabel = function(UserId)
var PageIndex = Cursor.PageIndex;
var TextTransform = Cursor.Transform;
var Color = DrawingDocument.Collaborative_GetTargetColor(UserId);
if (!Color)
return;
var Coords = DrawingDocument.ConvertCoordsToCursorWR(X, Y, PageIndex, TextTransform);
Api.sync_ShowForeignCursorLabel(UserId, Coords.X, Coords.Y, Color);
if (Cursor.ShowId)
clearTimeout(Cursor.ShowId);
......@@ -432,7 +427,15 @@ CWordCollaborativeEditing.prototype.Show_ForeignCursorLabel = function(UserId)
{
Cursor.ShowId = null;
Api.sync_HideForeignCursorLabel(UserId);
}, 3000);
}, FOREIGN_CURSOR_LABEL_HIDETIME);
var Color = DrawingDocument.Collaborative_GetTargetColor(UserId);
var Coords = DrawingDocument.Collaborative_GetTargetPosition(UserId);
//var Coords = DrawingDocument.ConvertCoordsToCursorWR(X, Y, PageIndex, TextTransform);
if (!Color || !Coords)
return;
this.Update_ForeignCursorLabelPosition(UserId, Coords.X, Coords.Y, Color);
};
CWordCollaborativeEditing.prototype.Add_ForeignCursorToShow = function(UserId)
{
......@@ -468,7 +471,7 @@ CWordCollaborativeEditing.prototype.Add_ForeignCursorXY = function(UserId, X, Y,
{
Cursor.ShowId = null;
Api.sync_HideForeignCursorLabel(UserId);
}, 3000);
}, FOREIGN_CURSOR_LABEL_HIDETIME);
}
}
else
......@@ -517,5 +520,17 @@ CWordCollaborativeEditing.prototype.Remove_ForeignCursorXY = function(UserId)
delete this.m_aForeignCursorsXY[UserId];
}
};
CWordCollaborativeEditing.prototype.Update_ForeignCursorLabelPosition = function(UserId, X, Y, Color)
{
if (!this.m_oLogicDocument)
return;
var Cursor = this.m_aForeignCursorsXY[UserId];
if (!Cursor || !Cursor.ShowId)
return;
var Api = this.m_oLogicDocument.Get_Api();
Api.sync_ShowForeignCursorLabel(UserId, X, Y, Color);
};
var CollaborativeEditing = new CWordCollaborativeEditing();
\ No newline at end of file
......@@ -5032,30 +5032,11 @@ asc_docs_api.prototype.sync_MouseMoveCallback = function(Data)
asc_docs_api.prototype.sync_ShowForeignCursorLabel = function(UserId, X, Y, Color)
{
// TODO: Временно делаем через события мыши
this.sync_MouseMoveStartCallback();
var MMData = new CMouseMoveData();
MMData.X_abs = X;
MMData.Y_abs = Y - 20;
MMData.Type = c_oAscMouseMoveDataTypes.LockedObject;
MMData.UserId = UserId;
MMData.LockedObjectType = c_oAscMouseMoveLockedObjectType.Common;
MMData.Color = Color;
this.sync_MouseMoveCallback(MMData);
this.sync_MouseMoveEndCallback();
//this.asc_fireCallback("asc_onShowForeignCursorLabel", UserId, X, Y, new CColor(Color.r, Color.g, Color.b, 255));
this.asc_fireCallback("asc_onShowForeignCursorLabel", UserId, X, Y, new CColor(Color.r, Color.g, Color.b, 255));
};
asc_docs_api.prototype.sync_HideForeignCursorLabel = function(UserId)
{
// TODO: Временно делаем через события мыши
this.sync_MouseMoveStartCallback();
var MMData = new CMouseMoveData();
MMData.Type = c_oAscMouseMoveDataTypes.Common;
this.sync_MouseMoveCallback(MMData);
this.sync_MouseMoveEndCallback();
//this.asc_fireCallback("asc_onHideForeignCursorLabel", UserId);
this.asc_fireCallback("asc_onHideForeignCursorLabel", UserId);
};
//-----------------------------------------------------------------
......
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