Commit cc5c0af5 authored by Alexander.Trofimov's avatar Alexander.Trofimov

use ScrollSettings

parent 7d237627
...@@ -57,12 +57,8 @@ ...@@ -57,12 +57,8 @@
vscrollStep: 10, vscrollStep: 10,
hscrollStep: 10, hscrollStep: 10,
scrollTimeout: 20, scrollTimeout: 20,
showArrows: true,//показывать или нет стрелки у скролла
//scrollBackgroundColor:"#DDDDDD",//цвет фона скролла
//scrollerColor:"#EDEDED",//цвет ползунка скрола
isViewerMode: false, isViewerMode: false,
wheelScrollLines: 3, wheelScrollLinesV: 3
isNeedInvertOnActive: false
}; };
this.view = undefined; this.view = undefined;
...@@ -352,7 +348,7 @@ ...@@ -352,7 +348,7 @@
}; };
asc_CEventsController.prototype._createScrollBars = function () { asc_CEventsController.prototype._createScrollBars = function () {
var self = this, opt = this.settings; var self = this, settings, opt = this.settings;
// vertical scroll bar // vertical scroll bar
this.vsb = document.createElement('div'); this.vsb = document.createElement('div');
...@@ -362,9 +358,14 @@ ...@@ -362,9 +358,14 @@
this.vsbHSt = document.getElementById("ws-v-scroll-helper").style; this.vsbHSt = document.getElementById("ws-v-scroll-helper").style;
if (!this.vsbApi) { if (!this.vsbApi) {
this.vsbApi = new AscCommon.ScrollObject(this.vsb.id, opt); settings = new AscCommon.ScrollSettings();
settings.vscrollStep = opt.vscrollStep;
settings.hscrollStep = opt.hscrollStep;
settings.wheelScrollLines = opt.wheelScrollLinesV;
this.vsbApi = new AscCommon.ScrollObject(this.vsb.id, settings);
this.vsbApi.bind("scrollvertical", function(evt) { this.vsbApi.bind("scrollvertical", function(evt) {
self.handlers.trigger("scrollY", evt.scrollPositionY / opt.vscrollStep); self.handlers.trigger("scrollY", evt.scrollPositionY / self.settings.vscrollStep);
}); });
this.vsbApi.bind("scrollVEnd", function(evt) { this.vsbApi.bind("scrollVEnd", function(evt) {
self.handlers.trigger("addRow"); self.handlers.trigger("addRow");
...@@ -385,9 +386,13 @@ ...@@ -385,9 +386,13 @@
this.hsbHSt = document.getElementById("ws-h-scroll-helper").style; this.hsbHSt = document.getElementById("ws-h-scroll-helper").style;
if (!this.hsbApi) { if (!this.hsbApi) {
this.hsbApi = new AscCommon.ScrollObject(this.hsb.id, $.extend(true, {}, opt, {wheelScrollLines: 1})); settings = new AscCommon.ScrollSettings();
settings.vscrollStep = opt.vscrollStep;
settings.hscrollStep = opt.hscrollStep;
this.hsbApi = new AscCommon.ScrollObject(this.hsb.id, settings);
this.hsbApi.bind("scrollhorizontal",function(evt) { this.hsbApi.bind("scrollhorizontal",function(evt) {
self.handlers.trigger("scrollX", evt.scrollPositionX / opt.hscrollStep); self.handlers.trigger("scrollX", evt.scrollPositionX / self.settings.hscrollStep);
}); });
this.hsbApi.bind("scrollHEnd",function(evt) { this.hsbApi.bind("scrollHEnd",function(evt) {
self.handlers.trigger("addColumn"); self.handlers.trigger("addColumn");
...@@ -1641,7 +1646,7 @@ ...@@ -1641,7 +1646,7 @@
self.scrollHorizontal(deltaX, event); self.scrollHorizontal(deltaX, event);
} }
if (deltaY) { if (deltaY) {
deltaY = Math.sign(deltaY) * Math.ceil(Math.abs(deltaY * self.settings.wheelScrollLines / 3)); deltaY = Math.sign(deltaY) * Math.ceil(Math.abs(deltaY * self.settings.wheelScrollLinesV / 3));
self.scrollVertical(deltaY, event); self.scrollVertical(deltaY, event);
} }
self._onMouseMove(event); self._onMouseMove(event);
......
This diff is collapsed.
...@@ -3472,7 +3472,7 @@ function CThumbnailsManager() ...@@ -3472,7 +3472,7 @@ function CThumbnailsManager()
} }
this.initEvents2MobileAdvances(); this.initEvents2MobileAdvances();
} };
this.initEvents2MobileAdvances = function() this.initEvents2MobileAdvances = function()
{ {
...@@ -3495,7 +3495,7 @@ function CThumbnailsManager() ...@@ -3495,7 +3495,7 @@ function CThumbnailsManager()
oThis.onMouseUp(e.changedTouches[0]); oThis.onMouseUp(e.changedTouches[0]);
return false; return false;
}; };
} };
this.GetThumbnailPagePosition = function(pageIndex) this.GetThumbnailPagePosition = function(pageIndex)
{ {
...@@ -3510,7 +3510,7 @@ function CThumbnailsManager() ...@@ -3510,7 +3510,7 @@ function CThumbnailsManager()
H : drawRect.bottom - drawRect.top + 1 H : drawRect.bottom - drawRect.top + 1
}; };
return _ret; return _ret;
} };
this.ConvertCoords = function(x, y, isPage, isFixed) this.ConvertCoords = function(x, y, isPage, isFixed)
{ {
...@@ -3560,7 +3560,7 @@ function CThumbnailsManager() ...@@ -3560,7 +3560,7 @@ function CThumbnailsManager()
} }
} }
return Pos; return Pos;
} };
this.ConvertCoords2 = function(x, y) this.ConvertCoords2 = function(x, y)
{ {
var Pos = {X : x, Y : y}; var Pos = {X : x, Y : y};
...@@ -3599,7 +3599,7 @@ function CThumbnailsManager() ...@@ -3599,7 +3599,7 @@ function CThumbnailsManager()
} }
return _MinPositionPage; return _MinPositionPage;
} };
this.IsSlideHidden = function(aSelected){ this.IsSlideHidden = function(aSelected){
var oPresentation = oThis.m_oWordControl.m_oLogicDocument; var oPresentation = oThis.m_oWordControl.m_oLogicDocument;
...@@ -3775,7 +3775,7 @@ function CThumbnailsManager() ...@@ -3775,7 +3775,7 @@ function CThumbnailsManager()
} }
return false; return false;
} };
this.ShowPage = function(pageNum) this.ShowPage = function(pageNum)
{ {
...@@ -3791,7 +3791,7 @@ function CThumbnailsManager() ...@@ -3791,7 +3791,7 @@ function CThumbnailsManager()
{ {
this.m_oWordControl.m_oScrollThumbApi.scrollByY(y2 - this.m_oWordControl.m_oThumbnails.HtmlElement.height); this.m_oWordControl.m_oScrollThumbApi.scrollByY(y2 - this.m_oWordControl.m_oThumbnails.HtmlElement.height);
} }
} };
this.SelectPage = function(pageNum) this.SelectPage = function(pageNum)
{ {
...@@ -3832,7 +3832,7 @@ function CThumbnailsManager() ...@@ -3832,7 +3832,7 @@ function CThumbnailsManager()
} }
} }
} }
} };
this.ClearCacheAttack = function() this.ClearCacheAttack = function()
{ {
...@@ -3844,7 +3844,7 @@ function CThumbnailsManager() ...@@ -3844,7 +3844,7 @@ function CThumbnailsManager()
} }
this.m_bIsUpdate = true; this.m_bIsUpdate = true;
} };
this.RecalculateAll = function() this.RecalculateAll = function()
{ {
this.SlideWidth = this.m_oWordControl.m_oLogicDocument.Width; this.SlideWidth = this.m_oWordControl.m_oLogicDocument.Width;
...@@ -3853,7 +3853,7 @@ function CThumbnailsManager() ...@@ -3853,7 +3853,7 @@ function CThumbnailsManager()
this.CheckSizes(); this.CheckSizes();
this.ClearCacheAttack(); this.ClearCacheAttack();
} };
this.onMouseMove = function(e) this.onMouseMove = function(e)
{ {
...@@ -3953,7 +3953,7 @@ function CThumbnailsManager() ...@@ -3953,7 +3953,7 @@ function CThumbnailsManager()
} }
oThis.m_oWordControl.m_oThumbnails.HtmlElement.style.cursor = cursor_moved; oThis.m_oWordControl.m_oThumbnails.HtmlElement.style.cursor = cursor_moved;
} };
this.CheckNeedAnimateScrolls = function(type) this.CheckNeedAnimateScrolls = function(type)
{ {
...@@ -4001,16 +4001,16 @@ function CThumbnailsManager() ...@@ -4001,16 +4001,16 @@ function CThumbnailsManager()
} }
return; return;
} }
} };
this.OnScrollTrackTop = function() this.OnScrollTrackTop = function()
{ {
oThis.m_oWordControl.m_oScrollThumbApi.scrollByY(-45); oThis.m_oWordControl.m_oScrollThumbApi.scrollByY(-45);
} };
this.OnScrollTrackBottom = function() this.OnScrollTrackBottom = function()
{ {
oThis.m_oWordControl.m_oScrollThumbApi.scrollByY(45); oThis.m_oWordControl.m_oScrollThumbApi.scrollByY(45);
} };
this.onMouseUp = function(e, bIsWindow) this.onMouseUp = function(e, bIsWindow)
{ {
...@@ -4084,7 +4084,7 @@ function CThumbnailsManager() ...@@ -4084,7 +4084,7 @@ function CThumbnailsManager()
oThis.MouseDownTrackPosition = -1; oThis.MouseDownTrackPosition = -1;
oThis.onMouseMove(e); oThis.onMouseMove(e);
} };
this.onMouseLeave = function(e) this.onMouseLeave = function(e)
{ {
...@@ -4094,7 +4094,7 @@ function CThumbnailsManager() ...@@ -4094,7 +4094,7 @@ function CThumbnailsManager()
oThis.m_arrPages[i].IsFocused = false; oThis.m_arrPages[i].IsFocused = false;
} }
oThis.OnUpdateOverlay(); oThis.OnUpdateOverlay();
} };
this.onMouseWhell = function(e) this.onMouseWhell = function(e)
{ {
...@@ -4127,7 +4127,7 @@ function CThumbnailsManager() ...@@ -4127,7 +4127,7 @@ function CThumbnailsManager()
else else
e.returnValue = false; e.returnValue = false;
return false; return false;
} };
// инициализация шрифта // инициализация шрифта
this.SetFont = function(font) this.SetFont = function(font)
...@@ -4152,7 +4152,7 @@ function CThumbnailsManager() ...@@ -4152,7 +4152,7 @@ function CThumbnailsManager()
oFontStyle = FontStyle.FontStyleBoldItalic; oFontStyle = FontStyle.FontStyleBoldItalic;
g_fontApplication.LoadFont(font.FontFamily.Name, AscCommon.g_font_loader, this.m_oFontManager, font.FontSize, oFontStyle, 96, 96); g_fontApplication.LoadFont(font.FontFamily.Name, AscCommon.g_font_loader, this.m_oFontManager, font.FontSize, oFontStyle, 96, 96);
} };
this.Init = function() this.Init = function()
{ {
...@@ -4216,7 +4216,7 @@ function CThumbnailsManager() ...@@ -4216,7 +4216,7 @@ function CThumbnailsManager()
} }
_ctx.putImageData(_data, 0, 0); _ctx.putImageData(_data, 0, 0);
} };
this.CheckSizes = function() this.CheckSizes = function()
{ {
...@@ -4309,17 +4309,15 @@ function CThumbnailsManager() ...@@ -4309,17 +4309,15 @@ function CThumbnailsManager()
nHeightPix += (this.SlidesCount - 1) * 3 * this.const_border_w; nHeightPix += (this.SlidesCount - 1) * 3 * this.const_border_w;
// теперь нужно выставить размеры // теперь нужно выставить размеры
var settings = { var settings = new AscCommon.ScrollSettings();
showArrows : false, settings.showArrows = false;
animateScroll : false, settings.screenW = word_control.m_oThumbnails.HtmlElement.width;
screenW : word_control.m_oThumbnails.HtmlElement.width, settings.screenH = word_control.m_oThumbnails.HtmlElement.height;
screenH : word_control.m_oThumbnails.HtmlElement.height, settings.cornerRadius = 1;
cornerRadius : 1, settings.slimScroll = true;
slimScroll : true, settings.scrollBackgroundColor = GlobalSkin.BackgroundColorThumbnails;
scrollBackgroundColor : GlobalSkin.BackgroundColorThumbnails, settings.scrollBackgroundColorHover = GlobalSkin.BackgroundColorThumbnails;
scrollBackgroundColorHover : GlobalSkin.BackgroundColorThumbnails, settings.scrollBackgroundColorActive = GlobalSkin.BackgroundColorThumbnails;
scrollBackgroundColorActive : GlobalSkin.BackgroundColorThumbnails
};
document.getElementById('panel_right_scroll_thmbnl').style.height = parseInt(nHeightPix) + "px"; document.getElementById('panel_right_scroll_thmbnl').style.height = parseInt(nHeightPix) + "px";
...@@ -4354,7 +4352,7 @@ function CThumbnailsManager() ...@@ -4354,7 +4352,7 @@ function CThumbnailsManager()
this.CalculatePlaces(); this.CalculatePlaces();
this.m_bIsUpdate = true; this.m_bIsUpdate = true;
} };
this.verticalScroll = function(sender, scrollPositionY, maxY, isAtTop, isAtBottom) this.verticalScroll = function(sender, scrollPositionY, maxY, isAtTop, isAtBottom)
{ {
...@@ -4369,7 +4367,7 @@ function CThumbnailsManager() ...@@ -4369,7 +4367,7 @@ function CThumbnailsManager()
if (!this.m_oWordControl.m_oApi.isMobileVersion) if (!this.m_oWordControl.m_oApi.isMobileVersion)
this.SetFocusElement(FOCUS_OBJECT_THUMBNAILS); this.SetFocusElement(FOCUS_OBJECT_THUMBNAILS);
} };
this.CalculatePlaces = function() this.CalculatePlaces = function()
{ {
...@@ -4446,7 +4444,7 @@ function CThumbnailsManager() ...@@ -4446,7 +4444,7 @@ function CThumbnailsManager()
{ {
this.m_lDrawingEnd = this.SlidesCount - 1; this.m_lDrawingEnd = this.SlidesCount - 1;
} }
} };
this.OnPaint = function() this.OnPaint = function()
{ {
...@@ -4530,7 +4528,7 @@ function CThumbnailsManager() ...@@ -4530,7 +4528,7 @@ function CThumbnailsManager()
} }
this.OnUpdateOverlay(); this.OnUpdateOverlay();
} };
this.OnUpdateOverlay = function() this.OnUpdateOverlay = function()
{ {
...@@ -4654,12 +4652,12 @@ function CThumbnailsManager() ...@@ -4654,12 +4652,12 @@ function CThumbnailsManager()
(this.MouseTrackCommonImage.width + 1) >> 1, this.MouseTrackCommonImage.height); (this.MouseTrackCommonImage.width + 1) >> 1, this.MouseTrackCommonImage.height);
} }
} }
} };
this.FocusRectDraw = function(ctx, x, y, r, b) this.FocusRectDraw = function(ctx, x, y, r, b)
{ {
ctx.rect(x - this.const_border_w, y, r - x + this.const_border_w, b - y); ctx.rect(x - this.const_border_w, y, r - x + this.const_border_w, b - y);
} };
this.FocusRectFlat = function(_color, ctx, x, y, r, b) this.FocusRectFlat = function(_color, ctx, x, y, r, b)
{ {
ctx.beginPath(); ctx.beginPath();
...@@ -4679,7 +4677,7 @@ function CThumbnailsManager() ...@@ -4679,7 +4677,7 @@ function CThumbnailsManager()
ctx.stroke(); ctx.stroke();
ctx.beginPath(); ctx.beginPath();
} }
} };
this.onCheckUpdate = function() this.onCheckUpdate = function()
{ {
...@@ -4770,7 +4768,7 @@ function CThumbnailsManager() ...@@ -4770,7 +4768,7 @@ function CThumbnailsManager()
this.OnPaint(); this.OnPaint();
this.m_bIsUpdate = false; this.m_bIsUpdate = false;
} };
this.SetFocusElement = function(type) this.SetFocusElement = function(type)
...@@ -4798,7 +4796,7 @@ function CThumbnailsManager() ...@@ -4798,7 +4796,7 @@ function CThumbnailsManager()
default: default:
break; break;
} }
} };
this.GetSelectedSlidesRange = function() this.GetSelectedSlidesRange = function()
{ {
...@@ -4816,7 +4814,7 @@ function CThumbnailsManager() ...@@ -4816,7 +4814,7 @@ function CThumbnailsManager()
} }
} }
return {Min : _min, Max : _max}; return {Min : _min, Max : _max};
} };
this.GetSelectedArray = function() this.GetSelectedArray = function()
{ {
...@@ -4830,7 +4828,7 @@ function CThumbnailsManager() ...@@ -4830,7 +4828,7 @@ function CThumbnailsManager()
} }
} }
return _array; return _array;
} };
this.CorrectShiftSelect = function(isTop, isEnd) this.CorrectShiftSelect = function(isTop, isEnd)
{ {
...@@ -4898,7 +4896,7 @@ function CThumbnailsManager() ...@@ -4898,7 +4896,7 @@ function CThumbnailsManager()
this.OnUpdateOverlay(); this.OnUpdateOverlay();
this.ShowPage(_page); this.ShowPage(_page);
} };
this.onKeyDown = function(e) this.onKeyDown = function(e)
{ {
...@@ -5302,7 +5300,7 @@ function CThumbnailsManager() ...@@ -5302,7 +5300,7 @@ function CThumbnailsManager()
e.preventDefault(); e.preventDefault();
return false; return false;
} };
} }
function DrawBackground(graphics, unifill, w, h) function DrawBackground(graphics, unifill, w, h)
...@@ -5755,26 +5753,19 @@ function CNotesDrawer(page) ...@@ -5755,26 +5753,19 @@ function CNotesDrawer(page)
return; return;
var element = this.HtmlPage.m_oNotes.HtmlElement; var element = this.HtmlPage.m_oNotes.HtmlElement;
var settings = { var settings = new AscCommon.ScrollSettings();
showArrows: true, settings.screenW = element.width;
animateScroll: false, settings.screenH = element.height;
screenW: element.width, settings.vsscrollStep = 45;
screenH: element.height, settings.hsscrollStep = 45;
screenAddW: 0, settings.contentW = 1;
screenAddH: 0, settings.contentH = 2 * this.OffsetY + ((height * g_dKoef_mm_to_pix) >> 0);
vsscrollStep: 45, settings.scrollerMinHeight = 5;
hsscrollStep: 45,
contentW: 1,
contentH: 2 * this.OffsetY + ((height * g_dKoef_mm_to_pix) >> 0),
scrollerMinHeight: 5
};
if (this.HtmlPage.bIsRetinaSupport) if (this.HtmlPage.bIsRetinaSupport)
{ {
settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW); settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW);
settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH); settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH);
settings.screenAddH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenAddH);
} }
this.ScrollMax = Math.max(0, settings.contentH - settings.screenH); this.ScrollMax = Math.max(0, settings.contentH - settings.screenH);
......
...@@ -2747,23 +2747,15 @@ function CEditorPage(api) ...@@ -2747,23 +2747,15 @@ function CEditorPage(api)
} }
}; };
this.UpdateScrolls = function() this.CreateScrollSettings = function()
{ {
if (window["NATIVE_EDITOR_ENJINE"]) var settings = new AscCommon.ScrollSettings();
return; settings.screenW = this.m_oEditor.HtmlElement.width;
settings.screenH = this.m_oEditor.HtmlElement.height;
var settings = { settings.vscrollStep = 45;
showArrows : true, settings.hscrollStep = 45;
animateScroll : false, settings.contentH = this.m_dDocumentHeight;
screenW : this.m_oEditor.HtmlElement.width, settings.contentW = this.m_dDocumentWidth;
screenH : this.m_oEditor.HtmlElement.height,
screenAddW : 0,
screenAddH : 0,
vsscrollStep : 45,
hsscrollStep : 45,
contentH : this.m_dDocumentHeight,
contentW : this.m_dDocumentWidth
};
if (this.m_bIsRuler) if (this.m_bIsRuler)
{ {
...@@ -2774,13 +2766,21 @@ function CEditorPage(api) ...@@ -2774,13 +2766,21 @@ function CEditorPage(api)
{ {
settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW); settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW);
settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH); settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH);
settings.screenAddH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenAddH); settings.screenAddH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenAddH);
} }
return settings;
};
if (this.m_bIsHorScrollVisible) this.UpdateScrolls = function()
{ {
var settings;
if (window["NATIVE_EDITOR_ENJINE"])
return;
settings = this.CreateScrollSettings();
settings.alwaysVisible = true; settings.alwaysVisible = true;
if (this.m_bIsHorScrollVisible)
{
if (this.m_oScrollHor_) if (this.m_oScrollHor_)
this.m_oScrollHor_.Repos(settings, true, undefined);//unbind("scrollhorizontal") this.m_oScrollHor_.Repos(settings, true, undefined);//unbind("scrollhorizontal")
else else
...@@ -2803,9 +2803,9 @@ function CEditorPage(api) ...@@ -2803,9 +2803,9 @@ function CEditorPage(api)
this.m_oScrollHorApi = this.m_oScrollHor_; this.m_oScrollHorApi = this.m_oScrollHor_;
} }
settings.alwaysVisible = undefined;
} }
settings = this.CreateScrollSettings();
if (this.m_oScrollVer_) if (this.m_oScrollVer_)
{ {
this.m_oScrollVer_.Repos(settings, undefined, true);//unbind("scrollvertical") this.m_oScrollVer_.Repos(settings, undefined, true);//unbind("scrollvertical")
...@@ -2813,9 +2813,7 @@ function CEditorPage(api) ...@@ -2813,9 +2813,7 @@ function CEditorPage(api)
else else
{ {
this.m_oScrollVer_ = new AscCommon.ScrollObject("id_vertical_scroll", this.m_oScrollVer_ = new AscCommon.ScrollObject("id_vertical_scroll", settings);
settings
);
this.m_oScrollVer_.onLockMouse = function(evt) this.m_oScrollVer_.onLockMouse = function(evt)
{ {
......
...@@ -830,7 +830,7 @@ function CEditorPage(api) ...@@ -830,7 +830,7 @@ function CEditorPage(api)
}; };
} }
} }
} };
this.onButtonRulersClick = function() this.onButtonRulersClick = function()
{ {
...@@ -2450,7 +2450,7 @@ function CEditorPage(api) ...@@ -2450,7 +2450,7 @@ function CEditorPage(api)
global_keyboardEvent.CtrlKey = false; global_keyboardEvent.CtrlKey = false;
global_keyboardEvent.ShiftKey = false; global_keyboardEvent.ShiftKey = false;
global_keyboardEvent.AltGr = false; global_keyboardEvent.AltGr = false;
} };
this.onKeyPress = function(e) this.onKeyPress = function(e)
{ {
if (AscCommon.g_clipboardBase.IsWorking()) if (AscCommon.g_clipboardBase.IsWorking())
...@@ -2576,29 +2576,30 @@ function CEditorPage(api) ...@@ -2576,29 +2576,30 @@ function CEditorPage(api)
} }
}; };
this.UpdateScrolls = function() this.CreateScrollSettings = function()
{ {
if (window["NATIVE_EDITOR_ENJINE"]) var settings = new AscCommon.ScrollSettings();
return; settings.screenW = this.m_oEditor.HtmlElement.width;
settings.screenH = this.m_oEditor.HtmlElement.height;
var settings = { settings.vscrollStep = 45;
showArrows : true, settings.hscrollStep = 45;
animateScroll : false, settings.isNeedInvertOnActive = GlobalSkin.isNeedInvertOnActive;
// scrollBackgroundColor: GlobalSkin.BackgroundScroll,
// scrollerColor:"#EDEDED",
screenW : this.m_oEditor.HtmlElement.width,
screenH : this.m_oEditor.HtmlElement.height,
vscrollStep : 45,
hscrollStep : 45,
isNeedInvertOnActive : GlobalSkin.isNeedInvertOnActive
};
if (this.bIsRetinaSupport) if (this.bIsRetinaSupport)
{ {
settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW); settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW);
settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH); settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH);
} }
return settings;
};
this.UpdateScrolls = function()
{
var settings;
if (window["NATIVE_EDITOR_ENJINE"])
return;
settings = this.CreateScrollSettings();
if (this.m_oScrollHor_) if (this.m_oScrollHor_)
this.m_oScrollHor_.Repos(settings, this.m_bIsHorScrollVisible); this.m_oScrollHor_.Repos(settings, this.m_bIsHorScrollVisible);
else else
...@@ -2609,18 +2610,19 @@ function CEditorPage(api) ...@@ -2609,18 +2610,19 @@ function CEditorPage(api)
{ {
AscCommon.check_MouseDownEvent(evt, true); AscCommon.check_MouseDownEvent(evt, true);
global_mouseEvent.LockMouse(); global_mouseEvent.LockMouse();
} };
this.m_oScrollHor_.offLockMouse = function(evt) this.m_oScrollHor_.offLockMouse = function(evt)
{ {
AscCommon.check_MouseUpEvent(evt); AscCommon.check_MouseUpEvent(evt);
} };
this.m_oScrollHor_.bind("scrollhorizontal", function(evt) this.m_oScrollHor_.bind("scrollhorizontal", function(evt)
{ {
oThis.horizontalScroll(this, evt.scrollD, evt.maxScrollX); oThis.horizontalScroll(this, evt.scrollD, evt.maxScrollX);
}) });
this.m_oScrollHorApi = this.m_oScrollHor_; this.m_oScrollHorApi = this.m_oScrollHor_;
} }
settings = this.CreateScrollSettings();
if (this.m_oScrollVer_) if (this.m_oScrollVer_)
{ {
this.m_oScrollVer_.Repos(settings, undefined, true); this.m_oScrollVer_.Repos(settings, undefined, true);
...@@ -2633,11 +2635,11 @@ function CEditorPage(api) ...@@ -2633,11 +2635,11 @@ function CEditorPage(api)
{ {
AscCommon.check_MouseDownEvent(evt, true); AscCommon.check_MouseDownEvent(evt, true);
global_mouseEvent.LockMouse(); global_mouseEvent.LockMouse();
} };
this.m_oScrollVer_.offLockMouse = function(evt) this.m_oScrollVer_.offLockMouse = function(evt)
{ {
AscCommon.check_MouseUpEvent(evt); AscCommon.check_MouseUpEvent(evt);
} };
this.m_oScrollVer_.bind("scrollvertical", function(evt) this.m_oScrollVer_.bind("scrollvertical", function(evt)
{ {
oThis.verticalScroll(this, evt.scrollD, evt.maxScrollY); oThis.verticalScroll(this, evt.scrollD, evt.maxScrollY);
......
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