Commit 60af5ca2 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

нужная позиция текстбокса под сафари-мак

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53882 954022d7-b5bf-4e40-9824-e11837661b57
parent 7aadaa2d
...@@ -957,6 +957,8 @@ function CDrawingDocument() ...@@ -957,6 +957,8 @@ function CDrawingDocument()
this.m_dTargetY = -1; this.m_dTargetY = -1;
this.m_dTargetSize = 1; this.m_dTargetSize = 1;
this.TargetHtmlElement = null; this.TargetHtmlElement = null;
this.TargetHtmlElementLeft = 0;
this.TargetHtmlElementTop = 0;
this.m_bIsSelection = false; this.m_bIsSelection = false;
this.m_bIsSearching = false; this.m_bIsSearching = false;
...@@ -1899,8 +1901,10 @@ function CDrawingDocument() ...@@ -1899,8 +1901,10 @@ function CDrawingDocument()
ctx.stroke(); ctx.stroke();
} }
this.TargetHtmlElement.style.left = Math.min(pos1.X, pos2.X) + "px"; this.TargetHtmlElementLeft = Math.min(pos1.X, pos2.X) >> 0;
this.TargetHtmlElement.style.top = Math.min(pos1.Y, pos2.Y) + "px"; this.TargetHtmlElementTop = Math.min(pos1.Y, pos2.Y) >> 0;
this.TargetHtmlElement.style.left = this.TargetHtmlElementLeft + "px";
this.TargetHtmlElement.style.top = this.TargetHtmlElementTop + "px";
} }
else else
{ {
...@@ -1931,8 +1935,10 @@ function CDrawingDocument() ...@@ -1931,8 +1935,10 @@ function CDrawingDocument()
var pos = this.ConvertCoordsToCursor(x, y); var pos = this.ConvertCoordsToCursor(x, y);
this.TargetHtmlElement.style.left = pos.X + "px"; this.TargetHtmlElementLeft = pos.X >> 0;
this.TargetHtmlElement.style.top = pos.Y + "px"; this.TargetHtmlElementTop = pos.Y >> 0;
this.TargetHtmlElement.style.left = this.TargetHtmlElementLeft + "px";
this.TargetHtmlElement.style.top = this.TargetHtmlElementTop + "px";
this.m_oWordControl.CheckTextBoxInputPos(); this.m_oWordControl.CheckTextBoxInputPos();
} }
......
...@@ -3227,8 +3227,8 @@ function CEditorPage(api) ...@@ -3227,8 +3227,8 @@ function CEditorPage(api)
if (this.TextBoxInput == null || !this.TextBoxInputFocus) if (this.TextBoxInput == null || !this.TextBoxInputFocus)
return; return;
var _left = parseInt(this.m_oDrawingDocument.TargetHtmlElement.style.left); var _left = this.m_oDrawingDocument.TargetHtmlElementLeft;
var _top = parseInt(this.m_oDrawingDocument.TargetHtmlElement.style.top); var _top = this.m_oDrawingDocument.TargetHtmlElementTop;
var _h = (this.m_oDrawingDocument.m_dTargetSize * this.m_nZoomValue * g_dKoef_mm_to_pix / 100) >> 0; var _h = (this.m_oDrawingDocument.m_dTargetSize * this.m_nZoomValue * g_dKoef_mm_to_pix / 100) >> 0;
......
...@@ -1739,6 +1739,8 @@ function CDrawingDocument() ...@@ -1739,6 +1739,8 @@ function CDrawingDocument()
this.NeedScrollToTargetFlag = false; this.NeedScrollToTargetFlag = false;
this.TargetHtmlElement = null; this.TargetHtmlElement = null;
this.TargetHtmlElementLeft = 0;
this.TargetHtmlElementTop = 0;
this.m_bIsBreakRecalculate = false; this.m_bIsBreakRecalculate = false;
this.m_bIsUpdateDocSize = false; this.m_bIsUpdateDocSize = false;
...@@ -2759,18 +2761,18 @@ function CDrawingDocument() ...@@ -2759,18 +2761,18 @@ function CDrawingDocument()
ctx.stroke(); ctx.stroke();
} }
oThis.TargetHtmlElementLeft = Math.min(pos1.X, pos2.X) >> 0;
oThis.TargetHtmlElementTop = Math.min(pos1.Y, pos2.Y) >> 0;
if ((!oThis.m_oWordControl.MobileTouchManager && !window.USER_AGENT_SAFARI_MACOS) || !window.USER_AGENT_WEBKIT) if ((!oThis.m_oWordControl.MobileTouchManager && !window.USER_AGENT_SAFARI_MACOS) || !window.USER_AGENT_WEBKIT)
{ {
this.TargetHtmlElement.style.left = Math.min(pos1.X, pos2.X) + "px"; oThis.TargetHtmlElement.style.left = oThis.TargetHtmlElementLeft + "px";
this.TargetHtmlElement.style.top = Math.min(pos1.Y, pos2.Y) + "px"; oThis.TargetHtmlElement.style.top = oThis.TargetHtmlElementTop + "px";
} }
else else
{ {
var __x = Math.min(pos1.X, pos2.X);
var __y = Math.min(pos1.Y, pos2.Y);
oThis.TargetHtmlElement.style.left = "0px"; oThis.TargetHtmlElement.style.left = "0px";
oThis.TargetHtmlElement.style.top = "0px"; oThis.TargetHtmlElement.style.top = "0px";
oThis.TargetHtmlElement.style["webkitTransform"] = "matrix(1, 0, 0, 1, " +__x + "," + __y + ")"; oThis.TargetHtmlElement.style["webkitTransform"] = "matrix(1, 0, 0, 1, " + oThis.TargetHtmlElementLeft + "," + oThis.TargetHtmlElementTop + ")";
} }
} }
else else
...@@ -2802,16 +2804,19 @@ function CDrawingDocument() ...@@ -2802,16 +2804,19 @@ function CDrawingDocument()
var pos = this.ConvertCoordsToCursor2(x, y, this.m_lCurrentPage); var pos = this.ConvertCoordsToCursor2(x, y, this.m_lCurrentPage);
this.TargetHtmlElementLeft = pos.X >> 0;
this.TargetHtmlElementTop = pos.Y >> 0;
if ((!oThis.m_oWordControl.MobileTouchManager && !window.USER_AGENT_SAFARI_MACOS) || !window.USER_AGENT_WEBKIT) if ((!oThis.m_oWordControl.MobileTouchManager && !window.USER_AGENT_SAFARI_MACOS) || !window.USER_AGENT_WEBKIT)
{ {
this.TargetHtmlElement.style.left = pos.X + "px"; this.TargetHtmlElement.style.left = this.TargetHtmlElementLeft + "px";
this.TargetHtmlElement.style.top = pos.Y + "px"; this.TargetHtmlElement.style.top = this.TargetHtmlElementTop + "px";
} }
else else
{ {
oThis.TargetHtmlElement.style.left = "0px"; oThis.TargetHtmlElement.style.left = "0px";
oThis.TargetHtmlElement.style.top = "0px"; oThis.TargetHtmlElement.style.top = "0px";
oThis.TargetHtmlElement.style["webkitTransform"] = "matrix(1, 0, 0, 1, " + pos.X + "," + pos.Y + ")"; oThis.TargetHtmlElement.style["webkitTransform"] = "matrix(1, 0, 0, 1, " + oThis.TargetHtmlElementLeft + "," + oThis.TargetHtmlElementTop + ")";
} }
this.m_oWordControl.CheckTextBoxInputPos(); this.m_oWordControl.CheckTextBoxInputPos();
...@@ -3154,8 +3159,10 @@ function CDrawingDocument() ...@@ -3154,8 +3159,10 @@ function CDrawingDocument()
return; return;
} }
oThis.TargetHtmlElement.style.left = pos.X + "px"; oThis.TargetHtmlElementLeft = pos.X >> 0;
oThis.TargetHtmlElement.style.top = pos.Y + "px"; oThis.TargetHtmlElementTop = pos.Y >> 0;
oThis.TargetHtmlElement.style.left = oThis.TargetHtmlElementLeft + "px";
oThis.TargetHtmlElement.style.top = oThis.TargetHtmlElementTop + "px";
this.m_oWordControl.CheckTextBoxInputPos(); this.m_oWordControl.CheckTextBoxInputPos();
} }
......
...@@ -3764,8 +3764,8 @@ function CEditorPage(api) ...@@ -3764,8 +3764,8 @@ function CEditorPage(api)
if (this.TextBoxInput == null || !this.TextBoxInputFocus) if (this.TextBoxInput == null || !this.TextBoxInputFocus)
return; return;
var _left = parseInt(this.m_oDrawingDocument.TargetHtmlElement.style.left); var _left = this.m_oDrawingDocument.TargetHtmlElementLeft;
var _top = parseInt(this.m_oDrawingDocument.TargetHtmlElement.style.top); var _top = this.m_oDrawingDocument.TargetHtmlElementTop;
var _h = (this.m_oDrawingDocument.m_dTargetSize * this.m_nZoomValue * g_dKoef_mm_to_pix / 100) >> 0; var _h = (this.m_oDrawingDocument.m_dTargetSize * this.m_nZoomValue * g_dKoef_mm_to_pix / 100) >> 0;
......
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