Commit 0558a8f2 authored by Oleg Korshul's avatar Oleg Korshul

Collaborate targets

parent 65fb8ea1
...@@ -691,7 +691,8 @@ function CDrawingCollaborativeTarget() ...@@ -691,7 +691,8 @@ function CDrawingCollaborativeTarget()
this.HtmlElementY = 0; this.HtmlElementY = 0;
this.Style = ""; this.Style = "";
this.IsInsertToDOM = false; this.HtmlParentId = -1; // 0 - main, 1 - notes
this.HtmlParent = null;
} }
CDrawingCollaborativeTarget.prototype = CDrawingCollaborativeTarget.prototype =
{ {
...@@ -732,8 +733,12 @@ CDrawingCollaborativeTarget.prototype = ...@@ -732,8 +733,12 @@ CDrawingCollaborativeTarget.prototype =
var _oldW = this.HtmlElement.width; var _oldW = this.HtmlElement.width;
var _oldH = this.HtmlElement.height; var _oldH = this.HtmlElement.height;
var isNotes = _drawing_doc.m_oWordControl.m_oLogicDocument.IsFocusOnNotes();
var _newW = 2; var _newW = 2;
var _newH = (this.Size * _drawing_doc.m_oWordControl.m_nZoomValue * g_dKoef_mm_to_pix / 100) >> 0; var _newH = (this.Size * _drawing_doc.m_oWordControl.m_nZoomValue * g_dKoef_mm_to_pix / 100) >> 0;
if (isNotes)
_newH = (this.Size * g_dKoef_mm_to_pix) >> 0;
if (null != this.Transform && !global_MatrixTransformer.IsIdentity2(this.Transform)) if (null != this.Transform && !global_MatrixTransformer.IsIdentity2(this.Transform))
{ {
...@@ -829,7 +834,15 @@ CDrawingCollaborativeTarget.prototype = ...@@ -829,7 +834,15 @@ CDrawingCollaborativeTarget.prototype =
_y += this.Transform.ty; _y += this.Transform.ty;
} }
var pos = _drawing_doc.ConvertCoordsToCursor(_x, _y); var pos = null;
if (!isNotes)
{
pos = _drawing_doc.ConvertCoordsToCursor(_x, _y);
}
else
{
pos = { X : (10 + _x * g_dKoef_mm_to_pix), Y : (_y * g_dKoef_mm_to_pix - _drawing_doc.m_oWordControl.m_oNotesApi.Scroll) };
}
this.HtmlElementX = pos.X >> 0; this.HtmlElementX = pos.X >> 0;
this.HtmlElementY = pos.Y >> 0; this.HtmlElementY = pos.Y >> 0;
...@@ -842,10 +855,19 @@ CDrawingCollaborativeTarget.prototype = ...@@ -842,10 +855,19 @@ CDrawingCollaborativeTarget.prototype =
AscCommon.CollaborativeEditing.Update_ForeignCursorLabelPosition(this.Id, this.HtmlElementX, this.HtmlElementY, this.Color); AscCommon.CollaborativeEditing.Update_ForeignCursorLabelPosition(this.Id, this.HtmlElementX, this.HtmlElementY, this.Color);
// 3) добавить, если нужно // 3) добавить, если нужно
if (bIsHtmlElementCreate) var HtmlParentIdNew = isNotes ? 1 : 0;
if (this.HtmlParent && (HtmlParentIdNew != this.HtmlParentId))
{
this.HtmlParent.removeChild(this.HtmlElement);
this.HtmlParent = null;
this.HtmlParentId = -1;
}
if (bIsHtmlElementCreate || (-1 == this.HtmlParentId))
{ {
_drawing_doc.m_oWordControl.m_oMainView.HtmlElement.appendChild(this.HtmlElement); this.HtmlParent = (0 == HtmlParentIdNew) ? _drawing_doc.m_oWordControl.m_oMainView.HtmlElement : _drawing_doc.m_oWordControl.m_oNotesContainer.HtmlElement;
this.IsInsertToDOM = true; this.HtmlParentId = HtmlParentIdNew;
this.HtmlParent.appendChild(this.HtmlElement);
} }
if (this.HtmlElement.style.display != "block") if (this.HtmlElement.style.display != "block")
...@@ -856,10 +878,12 @@ CDrawingCollaborativeTarget.prototype = ...@@ -856,10 +878,12 @@ CDrawingCollaborativeTarget.prototype =
Remove : function(_drawing_doc) Remove : function(_drawing_doc)
{ {
if (this.IsInsertToDOM) if (this.HtmlParent)
{ {
_drawing_doc.m_oWordControl.m_oMainView.HtmlElement.removeChild(this.HtmlElement); //_drawing_doc.m_oWordControl.m_oMainView.HtmlElement.removeChild(this.HtmlElement);
this.IsInsertToDOM = false; this.HtmlParent.removeChild(this.HtmlElement);
this.HtmlParent = null;
this.HtmlParentId = -1;
} }
}, },
......
...@@ -3613,6 +3613,9 @@ function CEditorPage(api) ...@@ -3613,6 +3613,9 @@ function CEditorPage(api)
oWordControl.Thumbnails.onCheckUpdate(); oWordControl.Thumbnails.onCheckUpdate();
} }
if (!isRepaint && oWordControl.m_oNotesApi.IsRepaint)
isRepaint = true;
if (oWordControl.IsSupportNotes && oWordControl.m_oNotesApi) if (oWordControl.IsSupportNotes && oWordControl.m_oNotesApi)
oWordControl.m_oNotesApi.CheckPaint(); oWordControl.m_oNotesApi.CheckPaint();
......
...@@ -1397,7 +1397,7 @@ background-repeat: no-repeat;\ ...@@ -1397,7 +1397,7 @@ background-repeat: no-repeat;\
if (true) if (true)
{ {
_innerHTML += "<div id=\"id_panel_notes\" class=\"block_elem\" style=\"background-color:#FFFFFF;\">\ _innerHTML += "<div id=\"id_panel_notes\" class=\"block_elem\" style=\"overflow:hidden;background-color:#FFFFFF;\">\
<canvas id=\"id_notes\" class=\"block_elem\" style=\"-ms-touch-action: none;-webkit-user-select: none;background-color:#FFFFFF;z-index:1\"></canvas>\ <canvas id=\"id_notes\" class=\"block_elem\" style=\"-ms-touch-action: none;-webkit-user-select: none;background-color:#FFFFFF;z-index:1\"></canvas>\
<canvas id=\"id_notes_overlay\" class=\"block_elem\" style=\"-ms-touch-action: none;-webkit-user-select: none;z-index:2\"></canvas>\ <canvas id=\"id_notes_overlay\" class=\"block_elem\" style=\"-ms-touch-action: none;-webkit-user-select: none;z-index:2\"></canvas>\
<div id=\"id_vertical_scroll_notes\" style=\"left:0;top:0;width:16px;overflow:hidden;position:absolute;\">\ <div id=\"id_vertical_scroll_notes\" style=\"left:0;top:0;width:16px;overflow:hidden;position:absolute;\">\
......
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