Commit cfdd9b72 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@48088 954022d7-b5bf-4e40-9824-e11837661b57
parent f6265b9f
......@@ -1660,13 +1660,43 @@ function CEditorPage(api)
return;
var delta = 0;
var deltaX = 0;
var deltaY = 0;
if (undefined != e.wheelDelta)
if (undefined != e.wheelDelta && e.wheelDelta != 0)
delta = (e.wheelDelta > 0) ? -45 : 45;
else
else if (undefined != e.detail && e.detail != 0)
delta = (e.detail > 0) ? 45 : -45;
oThis.m_oScrollVerApi.scrollBy(0, delta, false);
// New school multidimensional scroll (touchpads) deltas
deltaY = delta;
if (oThis.m_bIsHorScrollVisible)
{
if (e.axis !== undefined && e.axis === e.HORIZONTAL_AXIS)
{
deltaY = 0;
deltaX = delta;
}
// Webkit
if (e.wheelDeltaY !== undefined)
{
if (e.wheelDelta != 0)
deltaY = (e.wheelDeltaY > 0) ? -45 : 45;
}
if (e.wheelDeltaX !== undefined)
{
if (e.wheelDeltaX != 0)
deltaX = (e.wheelDeltaX > 0) ? -45 : 45;
}
}
if (0 != deltaX)
oThis.m_oScrollHorApi.scrollBy(deltaX, 0, false);
else if (0 != deltaY)
oThis.m_oScrollVerApi.scrollBy(0, deltaY, false);
if (e.preventDefault)
e.preventDefault();
......@@ -3549,4 +3579,4 @@ if(window.addEventListener)
function sendStatus(Message)
{
editor.sync_StatusMessage(Message);
}
\ No newline at end of file
}
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