Commit 4b456e40 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander.Trofimov

запрет зума приложений Word/PowerPoint в браузере

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@68043 954022d7-b5bf-4e40-9824-e11837661b57
parent 631867e3
...@@ -64,5 +64,17 @@ AscBrowser.isArm = (AscBrowser.userAgent.indexOf("arm") > -1); ...@@ -64,5 +64,17 @@ AscBrowser.isArm = (AscBrowser.userAgent.indexOf("arm") > -1);
AscBrowser.isMozilla = !AscBrowser.isIE && (AscBrowser.userAgent.indexOf("firefox") > -1); AscBrowser.isMozilla = !AscBrowser.isIE && (AscBrowser.userAgent.indexOf("firefox") > -1);
AscBrowser.zoom = 1;
AscBrowser.checkZoom = function()
{
if (AscBrowser.isChrome)
{
document.firstElementChild.style.zoom = "reset";
AscBrowser.zoom = window.outerWidth / window.innerWidth;
}
};
AscBrowser.checkZoom();
// detect retina (http://habrahabr.ru/post/159419/) // detect retina (http://habrahabr.ru/post/159419/)
AscBrowser.isRetina = 2 === window.devicePixelRatio; AscBrowser.isRetina = (Math.abs(2 - (window.devicePixelRatio / AscBrowser.zoom)) < 0.01);
\ No newline at end of file
...@@ -2370,6 +2370,8 @@ function CEditorPage(api) ...@@ -2370,6 +2370,8 @@ function CEditorPage(api)
this.OnResize = function(isAttack) this.OnResize = function(isAttack)
{ {
AscBrowser.checkZoom();
var isNewSize = this.checkBodySize(); var isNewSize = this.checkBodySize();
if (!isNewSize && false === isAttack) if (!isNewSize && false === isAttack)
{ {
......
...@@ -2819,6 +2819,8 @@ function CEditorPage(api) ...@@ -2819,6 +2819,8 @@ function CEditorPage(api)
this.OnResize = function(isAttack) this.OnResize = function(isAttack)
{ {
AscBrowser.checkZoom();
var isNewSize = this.checkBodySize(); var isNewSize = this.checkBodySize();
if (!isNewSize && false === isAttack) if (!isNewSize && false === isAttack)
return; return;
......
...@@ -184,6 +184,10 @@ function check_MouseMoveEvent(e) ...@@ -184,6 +184,10 @@ function check_MouseMoveEvent(e)
global_mouseEvent.X = e.clientX; global_mouseEvent.X = e.clientX;
global_mouseEvent.Y = e.clientY; global_mouseEvent.Y = e.clientY;
} }
global_mouseEvent.X = (global_mouseEvent.X * AscBrowser.zoom) >> 0;
global_mouseEvent.Y = (global_mouseEvent.Y * AscBrowser.zoom) >> 0;
global_mouseEvent.AltKey = e.altKey; global_mouseEvent.AltKey = e.altKey;
global_mouseEvent.ShiftKey = e.shiftKey; global_mouseEvent.ShiftKey = e.shiftKey;
global_mouseEvent.CtrlKey = e.ctrlKey || e.metaKey; global_mouseEvent.CtrlKey = e.ctrlKey || e.metaKey;
...@@ -229,6 +233,9 @@ function check_MouseUpEvent(e) ...@@ -229,6 +233,9 @@ function check_MouseUpEvent(e)
global_mouseEvent.X = e.clientX; global_mouseEvent.X = e.clientX;
global_mouseEvent.Y = e.clientY; global_mouseEvent.Y = e.clientY;
} }
global_mouseEvent.X = (global_mouseEvent.X * AscBrowser.zoom) >> 0;
global_mouseEvent.Y = (global_mouseEvent.Y * AscBrowser.zoom) >> 0;
global_mouseEvent.AltKey = e.altKey; global_mouseEvent.AltKey = e.altKey;
global_mouseEvent.ShiftKey = e.shiftKey; global_mouseEvent.ShiftKey = e.shiftKey;
...@@ -276,6 +283,9 @@ function check_MouseDownEvent(e, isClicks) ...@@ -276,6 +283,9 @@ function check_MouseDownEvent(e, isClicks)
global_mouseEvent.X = e.clientX; global_mouseEvent.X = e.clientX;
global_mouseEvent.Y = e.clientY; global_mouseEvent.Y = e.clientY;
} }
global_mouseEvent.X = (global_mouseEvent.X * AscBrowser.zoom) >> 0;
global_mouseEvent.Y = (global_mouseEvent.Y * AscBrowser.zoom) >> 0;
global_mouseEvent.LastX = global_mouseEvent.X; global_mouseEvent.LastX = global_mouseEvent.X;
global_mouseEvent.LastY = global_mouseEvent.Y; global_mouseEvent.LastY = global_mouseEvent.Y;
......
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