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

use ScrollSettings

parent 7d237627
......@@ -57,12 +57,8 @@
vscrollStep: 10,
hscrollStep: 10,
scrollTimeout: 20,
showArrows: true,//показывать или нет стрелки у скролла
//scrollBackgroundColor:"#DDDDDD",//цвет фона скролла
//scrollerColor:"#EDEDED",//цвет ползунка скрола
isViewerMode: false,
wheelScrollLines: 3,
isNeedInvertOnActive: false
wheelScrollLinesV: 3
};
this.view = undefined;
......@@ -352,7 +348,7 @@
};
asc_CEventsController.prototype._createScrollBars = function () {
var self = this, opt = this.settings;
var self = this, settings, opt = this.settings;
// vertical scroll bar
this.vsb = document.createElement('div');
......@@ -362,9 +358,14 @@
this.vsbHSt = document.getElementById("ws-v-scroll-helper").style;
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) {
self.handlers.trigger("scrollY", evt.scrollPositionY / opt.vscrollStep);
self.handlers.trigger("scrollY", evt.scrollPositionY / self.settings.vscrollStep);
});
this.vsbApi.bind("scrollVEnd", function(evt) {
self.handlers.trigger("addRow");
......@@ -385,9 +386,13 @@
this.hsbHSt = document.getElementById("ws-h-scroll-helper").style;
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) {
self.handlers.trigger("scrollX", evt.scrollPositionX / opt.hscrollStep);
self.handlers.trigger("scrollX", evt.scrollPositionX / self.settings.hscrollStep);
});
this.hsbApi.bind("scrollHEnd",function(evt) {
self.handlers.trigger("addColumn");
......@@ -1641,7 +1646,7 @@
self.scrollHorizontal(deltaX, event);
}
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._onMouseMove(event);
......
......@@ -122,31 +122,31 @@ function CArrowDrawer( settings ) {
this.ColorGradStart = [];
this.ColorGradEnd = [];
this.ColorGradStart[ScrollOverType.NONE] = HEXTORGB( settings && settings.arrowColor ? settings.arrowColor : "#888888" );
this.ColorGradEnd[ScrollOverType.NONE] = HEXTORGB( settings && settings.arrowColor ? settings.arrowColor : "#888888" );
this.ColorGradStart[ScrollOverType.NONE] = HEXTORGB( settings.arrowColor );
this.ColorGradEnd[ScrollOverType.NONE] = HEXTORGB( settings.arrowColor );
this.ColorGradStart[ScrollOverType.STABLE] = HEXTORGB( settings && settings.arrowStableColor ? settings.arrowStableColor : "#888888" );
this.ColorGradEnd[ScrollOverType.STABLE] = HEXTORGB( settings && settings.arrowStableColor ? settings.arrowStableColor : "#888888" );
this.ColorGradStart[ScrollOverType.STABLE] = HEXTORGB( settings.arrowStableColor );
this.ColorGradEnd[ScrollOverType.STABLE] = HEXTORGB( settings.arrowStableColor );
this.ColorGradStart[ScrollOverType.OVER] = HEXTORGB( settings && settings.arrowOverColor ? settings.arrowOverColor : "#f1f1f1" );
this.ColorGradEnd[ScrollOverType.OVER] = HEXTORGB( settings && settings.arrowOverColor ? settings.arrowOverColor : "#f1f1f1" );
this.ColorGradStart[ScrollOverType.OVER] = HEXTORGB( settings.arrowOverColor );
this.ColorGradEnd[ScrollOverType.OVER] = HEXTORGB( settings.arrowOverColor );
this.ColorGradStart[ScrollOverType.ACTIVE] = HEXTORGB( settings && settings.arrowActiveColor ? settings.arrowActiveColor : "#f1f1f1" );
this.ColorGradEnd[ScrollOverType.ACTIVE] = HEXTORGB( settings && settings.arrowActiveColor ? settings.arrowActiveColor : "#f1f1f1" );
this.ColorGradStart[ScrollOverType.ACTIVE] = HEXTORGB( settings.arrowActiveColor );
this.ColorGradEnd[ScrollOverType.ACTIVE] = HEXTORGB( settings.arrowActiveColor );
this.ColorBorderNone = settings && settings.arrowBorderColor ? settings.arrowBorderColor : "#cfcfcf";
this.ColorBorderStable = settings && settings.arrowStableBorderColor ? settings.arrowStableBorderColor : "#cfcfcf";
this.ColorBorderOver = settings && settings.arrowOverBorderColor ? settings.arrowOverBorderColor : "#cfcfcf";
this.ColorBorderActive = settings && settings.arrowActiveBorderColor ? settings.arrowActiveBorderColor : "#848484";
this.ColorBorderNone = settings.arrowBorderColor;
this.ColorBorderStable = settings.arrowStableBorderColor;
this.ColorBorderOver = settings.arrowOverBorderColor;
this.ColorBorderActive = settings.arrowActiveBorderColor;
this.ColorBackNone = settings && settings.arrowBackgroundColor ? settings.arrowBackgroundColor : "#F1F1F1";
this.ColorBackStable = settings && settings.arrowStableBackgroundColor ? settings.arrowStableBackgroundColor : "#F1F1F1";
this.ColorBackOver = settings && settings.arrowOverBackgroundColor ? settings.arrowOverBackgroundColor : "#cfcfcf";
this.ColorBackActive = settings && settings.arrowActiveBackgroundColor ? settings.arrowActiveBackgroundColor : "#848484";
this.ColorBackNone = settings.arrowBackgroundColor;
this.ColorBackStable = settings.arrowStableBackgroundColor;
this.ColorBackOver = settings.arrowOverBackgroundColor;
this.ColorBackActive = settings.arrowActiveBackgroundColor;
// вот такие мега настройки для кастомизации)
this.IsDrawBorderInNoneMode = false;
this.IsDrawBorders = true
this.IsDrawBorders = true;
// имя - направление стрелки
this.ImageLeft = null;
......@@ -154,7 +154,7 @@ function CArrowDrawer( settings ) {
this.ImageRight = null;
this.ImageBottom = null;
this.IsNeedInvertOnActive = settings && settings.isNeedInvertOnActive ? settings.isNeedInvertOnActive : false;
this.IsNeedInvertOnActive = settings.isNeedInvertOnActive;
this.lastArrowStatus1 = -1;
this.lastArrowStatus2 = -1;
......@@ -176,7 +176,7 @@ function CArrowDrawer( settings ) {
this.fadeInActive2 = false;
this.fadeOutActive2 = false;
this.fadeInFadeOutDelay = settings.fadeInFadeOutDelay ? settings.fadeInFadeOutDelay : 30;
this.fadeInFadeOutDelay = settings.fadeInFadeOutDelay || 30;
}
CArrowDrawer.prototype.InitSize = function ( sizeW, sizeH, is_retina ) {
......@@ -1481,10 +1481,13 @@ function _HEXTORGB_( colorHEX ) {
/**
* @constructor
*/
function scrollSettings() {
this.showArrows = false;
function ScrollSettings() {
this.showArrows = true;
this.screenW = -1;
this.screenH = -1;
this.screenAddH = 0;
this.contentH = undefined;
this.contentW = undefined;
this.scrollerMinHeight = 34;
this.scrollerMaxHeight = 99999;
this.scrollerMinWidth = 34;
......@@ -1528,6 +1531,7 @@ function _HEXTORGB_( colorHEX ) {
this.cornerRadius = 0;
this.slimScroll = false;
this.alwaysVisible = false;
this.isNeedInvertOnActive = false;
}
/**
......@@ -1538,78 +1542,7 @@ function ScrollObject( elemID, settings, dbg ) {
debug = dbg;
this.that = this;
var extendSettings = function ( settings1, settings2 ) {
var _st = {};
if ( settings1 == null || settings1 == undefined )
return settings2;
else for ( var _item in settings1 ) {
if ( typeof settings1[_item] === "object" )
_st[_item] = extendSettings( _st, settings1[_item] );
else
_st[_item] = settings1[_item];
}
for ( var _item in settings2 ) {
if ( !_st.hasOwnProperty( _item ) ) {
if ( typeof settings2[_item] === "object" )
_st[_item] = extendSettings( _st, settings2[_item] );
else
_st[_item] = settings2[_item];
}
}
return _st;
};
var scrollSettings = {
showArrows:false,
screenW:-1,
screenH:-1,
scrollerMinHeight:34,
scrollerMaxHeight:99999,
scrollerMinWidth:34,
scrollerMaxWidth:99999,
initialDelay:300,
arrowRepeatFreq:50,
trackClickRepeatFreq:70,
scrollPagePercent:1. / 8,
arrowDim:13,
marginScroller:4,
scrollerColor:"#f1f1f1",
scrollerColorOver:"#cfcfcf",
scrollerColorLayerOver:"#cfcfcf",
scrollerColorActive:"#ADADAD",
scrollBackgroundColor:"#f4f4f4",
scrollBackgroundColorHover:"#f4f4f4",
scrollBackgroundColorActive:"#f4f4f4",
strokeStyleNone:"#cfcfcf",
strokeStyleOver:"#cfcfcf",
strokeStyleActive:"#ADADAD",
vscrollStep:10,
hscrollStep:10,
wheelScrollLines:1,
arrowColor:"#ADADAD",
arrowBorderColor:"#cfcfcf",
arrowBackgroundColor:"#F1F1F1",
arrowStableColor:"#ADADAD",
arrowStableBorderColor:"#cfcfcf",
arrowStableBackgroundColor:"#F1F1F1",
arrowOverColor:"#f1f1f1",
arrowOverBorderColor:"#cfcfcf",
arrowOverBackgroundColor:"#cfcfcf",
arrowActiveColor:"#f1f1f1",
arrowActiveBorderColor:"#ADADAD",
arrowActiveBackgroundColor:"#ADADAD",
fadeInFadeOutDelay:20,
piperColor:"#cfcfcf",
piperColorHover:"#f1f1f1",
arrowSizeW: 13,
arrowSizeH: 13,
cornerRadius: 0,
slimScroll: false,
alwaysVisible: false
};
this.settings = extendSettings( settings, scrollSettings );
this.settings = settings;
this.ArrowDrawer = new CArrowDrawer( this.settings );
this.mouseUp = false;
......@@ -1808,15 +1741,15 @@ ScrollObject.prototype = {
this.canvas.ontouchstart = function ( e ) {
_that.evt_mousedown( e.touches[0] );
return false;
}
};
this.canvas.ontouchmove = function ( e ) {
_that.evt_mousemove( e.touches[0] );
return false;
}
};
this.canvas.ontouchend = function ( e ) {
_that.evt_mouseup( e.changedTouches[0] );
return false;
}
};
if ( this.canvas.addEventListener ){
this.canvas.addEventListener( 'DOMMouseScroll', this.evt_mousewheel, false );
......@@ -1891,7 +1824,7 @@ ScrollObject.prototype = {
this.scroller.w = Math.ceil( 1 / percentInViewH * this.horizontalTrackWidth );
if ( this.scroller.w < this.settings.scrollerMinWidth )
this.scroller.w = this.settings.scrollerMinWidth
this.scroller.w = this.settings.scrollerMinWidth;
else if ( this.scroller.w > this.settings.scrollerMaxWidth )
this.scroller.w = this.settings.scrollerMaxWidth;
this.scrollCoeff = this.maxScrollX / Math.max( 1, this.paneWidth - this.scroller.w );
......@@ -1913,7 +1846,7 @@ ScrollObject.prototype = {
if (bIsVerAttack)
{
var _canvasH = settings.screenH;
if (undefined !== _canvasH && undefined !== settings.screenAddH)
if (undefined !== _canvasH && settings.screenAddH)
_canvasH += settings.screenAddH;
if (_canvasH == this.canvasH && undefined !== settings.contentH)
......@@ -2301,7 +2234,7 @@ ScrollObject.prototype = {
}
}
ctx_piperImg.putImageData( _data, 0, 0 )
ctx_piperImg.putImageData( _data, 0, 0 );
img = that.piperImgHor[0];
}
......@@ -2528,11 +2461,11 @@ ScrollObject.prototype = {
that.context.beginPath();
if ( that.isVerticalScroll && that.maxScrollY != 0 ) {
var _y = that.scroller.y >> 0, arrow = that.settings.showArrows ? that.arrowPosition : 0
var _y = that.scroller.y >> 0, arrow = that.settings.showArrows ? that.arrowPosition : 0;
if ( _y < arrow ) {
_y = arrow;
}
var _b = Math.round(that.scroller.y + that.scroller.h)// >> 0;
var _b = Math.round(that.scroller.y + that.scroller.h);// >> 0;
if ( _b > (that.canvasH - arrow - 1) ) {
_b = that.canvasH - arrow - 1;
}
......@@ -2542,7 +2475,7 @@ ScrollObject.prototype = {
}
}
else if ( that.isHorizontalScroll && that.maxScrollX != 0 ) {
var _x = that.scroller.x >> 0, arrow = that.settings.showArrows ? that.arrowPosition : 0
var _x = that.scroller.x >> 0, arrow = that.settings.showArrows ? that.arrowPosition : 0;
if ( _x < arrow ) {
_x = arrow;
}
......@@ -3435,6 +3368,6 @@ ScrollObject.prototype = {
};
//---------------------------------------------------------export---------------------------------------------------
window["AscCommon"].scrollSettings = scrollSettings;
window["AscCommon"].ScrollSettings = ScrollSettings;
window["AscCommon"].ScrollObject = ScrollObject;
})(window);
......@@ -3472,7 +3472,7 @@ function CThumbnailsManager()
}
this.initEvents2MobileAdvances();
}
};
this.initEvents2MobileAdvances = function()
{
......@@ -3495,7 +3495,7 @@ function CThumbnailsManager()
oThis.onMouseUp(e.changedTouches[0]);
return false;
};
}
};
this.GetThumbnailPagePosition = function(pageIndex)
{
......@@ -3510,7 +3510,7 @@ function CThumbnailsManager()
H : drawRect.bottom - drawRect.top + 1
};
return _ret;
}
};
this.ConvertCoords = function(x, y, isPage, isFixed)
{
......@@ -3560,7 +3560,7 @@ function CThumbnailsManager()
}
}
return Pos;
}
};
this.ConvertCoords2 = function(x, y)
{
var Pos = {X : x, Y : y};
......@@ -3599,7 +3599,7 @@ function CThumbnailsManager()
}
return _MinPositionPage;
}
};
this.IsSlideHidden = function(aSelected){
var oPresentation = oThis.m_oWordControl.m_oLogicDocument;
......@@ -3775,7 +3775,7 @@ function CThumbnailsManager()
}
return false;
}
};
this.ShowPage = function(pageNum)
{
......@@ -3791,7 +3791,7 @@ function CThumbnailsManager()
{
this.m_oWordControl.m_oScrollThumbApi.scrollByY(y2 - this.m_oWordControl.m_oThumbnails.HtmlElement.height);
}
}
};
this.SelectPage = function(pageNum)
{
......@@ -3832,7 +3832,7 @@ function CThumbnailsManager()
}
}
}
}
};
this.ClearCacheAttack = function()
{
......@@ -3844,7 +3844,7 @@ function CThumbnailsManager()
}
this.m_bIsUpdate = true;
}
};
this.RecalculateAll = function()
{
this.SlideWidth = this.m_oWordControl.m_oLogicDocument.Width;
......@@ -3853,7 +3853,7 @@ function CThumbnailsManager()
this.CheckSizes();
this.ClearCacheAttack();
}
};
this.onMouseMove = function(e)
{
......@@ -3953,7 +3953,7 @@ function CThumbnailsManager()
}
oThis.m_oWordControl.m_oThumbnails.HtmlElement.style.cursor = cursor_moved;
}
};
this.CheckNeedAnimateScrolls = function(type)
{
......@@ -4001,16 +4001,16 @@ function CThumbnailsManager()
}
return;
}
}
};
this.OnScrollTrackTop = function()
{
oThis.m_oWordControl.m_oScrollThumbApi.scrollByY(-45);
}
};
this.OnScrollTrackBottom = function()
{
oThis.m_oWordControl.m_oScrollThumbApi.scrollByY(45);
}
};
this.onMouseUp = function(e, bIsWindow)
{
......@@ -4084,7 +4084,7 @@ function CThumbnailsManager()
oThis.MouseDownTrackPosition = -1;
oThis.onMouseMove(e);
}
};
this.onMouseLeave = function(e)
{
......@@ -4094,7 +4094,7 @@ function CThumbnailsManager()
oThis.m_arrPages[i].IsFocused = false;
}
oThis.OnUpdateOverlay();
}
};
this.onMouseWhell = function(e)
{
......@@ -4127,7 +4127,7 @@ function CThumbnailsManager()
else
e.returnValue = false;
return false;
}
};
// инициализация шрифта
this.SetFont = function(font)
......@@ -4152,7 +4152,7 @@ function CThumbnailsManager()
oFontStyle = FontStyle.FontStyleBoldItalic;
g_fontApplication.LoadFont(font.FontFamily.Name, AscCommon.g_font_loader, this.m_oFontManager, font.FontSize, oFontStyle, 96, 96);
}
};
this.Init = function()
{
......@@ -4216,7 +4216,7 @@ function CThumbnailsManager()
}
_ctx.putImageData(_data, 0, 0);
}
};
this.CheckSizes = function()
{
......@@ -4309,17 +4309,15 @@ function CThumbnailsManager()
nHeightPix += (this.SlidesCount - 1) * 3 * this.const_border_w;
// теперь нужно выставить размеры
var settings = {
showArrows : false,
animateScroll : false,
screenW : word_control.m_oThumbnails.HtmlElement.width,
screenH : word_control.m_oThumbnails.HtmlElement.height,
cornerRadius : 1,
slimScroll : true,
scrollBackgroundColor : GlobalSkin.BackgroundColorThumbnails,
scrollBackgroundColorHover : GlobalSkin.BackgroundColorThumbnails,
scrollBackgroundColorActive : GlobalSkin.BackgroundColorThumbnails
};
var settings = new AscCommon.ScrollSettings();
settings.showArrows = false;
settings.screenW = word_control.m_oThumbnails.HtmlElement.width;
settings.screenH = word_control.m_oThumbnails.HtmlElement.height;
settings.cornerRadius = 1;
settings.slimScroll = true;
settings.scrollBackgroundColor = GlobalSkin.BackgroundColorThumbnails;
settings.scrollBackgroundColorHover = GlobalSkin.BackgroundColorThumbnails;
settings.scrollBackgroundColorActive = GlobalSkin.BackgroundColorThumbnails;
document.getElementById('panel_right_scroll_thmbnl').style.height = parseInt(nHeightPix) + "px";
......@@ -4354,7 +4352,7 @@ function CThumbnailsManager()
this.CalculatePlaces();
this.m_bIsUpdate = true;
}
};
this.verticalScroll = function(sender, scrollPositionY, maxY, isAtTop, isAtBottom)
{
......@@ -4369,7 +4367,7 @@ function CThumbnailsManager()
if (!this.m_oWordControl.m_oApi.isMobileVersion)
this.SetFocusElement(FOCUS_OBJECT_THUMBNAILS);
}
};
this.CalculatePlaces = function()
{
......@@ -4446,7 +4444,7 @@ function CThumbnailsManager()
{
this.m_lDrawingEnd = this.SlidesCount - 1;
}
}
};
this.OnPaint = function()
{
......@@ -4530,7 +4528,7 @@ function CThumbnailsManager()
}
this.OnUpdateOverlay();
}
};
this.OnUpdateOverlay = function()
{
......@@ -4654,12 +4652,12 @@ function CThumbnailsManager()
(this.MouseTrackCommonImage.width + 1) >> 1, this.MouseTrackCommonImage.height);
}
}
}
};
this.FocusRectDraw = function(ctx, x, y, r, b)
{
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)
{
ctx.beginPath();
......@@ -4679,7 +4677,7 @@ function CThumbnailsManager()
ctx.stroke();
ctx.beginPath();
}
}
};
this.onCheckUpdate = function()
{
......@@ -4770,7 +4768,7 @@ function CThumbnailsManager()
this.OnPaint();
this.m_bIsUpdate = false;
}
};
this.SetFocusElement = function(type)
......@@ -4798,7 +4796,7 @@ function CThumbnailsManager()
default:
break;
}
}
};
this.GetSelectedSlidesRange = function()
{
......@@ -4816,7 +4814,7 @@ function CThumbnailsManager()
}
}
return {Min : _min, Max : _max};
}
};
this.GetSelectedArray = function()
{
......@@ -4830,7 +4828,7 @@ function CThumbnailsManager()
}
}
return _array;
}
};
this.CorrectShiftSelect = function(isTop, isEnd)
{
......@@ -4898,7 +4896,7 @@ function CThumbnailsManager()
this.OnUpdateOverlay();
this.ShowPage(_page);
}
};
this.onKeyDown = function(e)
{
......@@ -5302,7 +5300,7 @@ function CThumbnailsManager()
e.preventDefault();
return false;
}
};
}
function DrawBackground(graphics, unifill, w, h)
......@@ -5755,26 +5753,19 @@ function CNotesDrawer(page)
return;
var element = this.HtmlPage.m_oNotes.HtmlElement;
var settings = {
showArrows: true,
animateScroll: false,
screenW: element.width,
screenH: element.height,
screenAddW: 0,
screenAddH: 0,
vsscrollStep: 45,
hsscrollStep: 45,
contentW: 1,
contentH: 2 * this.OffsetY + ((height * g_dKoef_mm_to_pix) >> 0),
scrollerMinHeight: 5
};
var settings = new AscCommon.ScrollSettings();
settings.screenW = element.width;
settings.screenH = element.height;
settings.vsscrollStep = 45;
settings.hsscrollStep = 45;
settings.contentW = 1;
settings.contentH = 2 * this.OffsetY + ((height * g_dKoef_mm_to_pix) >> 0);
settings.scrollerMinHeight = 5;
if (this.HtmlPage.bIsRetinaSupport)
{
settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW);
settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH);
settings.screenAddH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenAddH);
}
this.ScrollMax = Math.max(0, settings.contentH - settings.screenH);
......
......@@ -2747,23 +2747,15 @@ function CEditorPage(api)
}
};
this.UpdateScrolls = function()
this.CreateScrollSettings = function()
{
if (window["NATIVE_EDITOR_ENJINE"])
return;
var settings = {
showArrows : true,
animateScroll : false,
screenW : this.m_oEditor.HtmlElement.width,
screenH : this.m_oEditor.HtmlElement.height,
screenAddW : 0,
screenAddH : 0,
vsscrollStep : 45,
hsscrollStep : 45,
contentH : this.m_dDocumentHeight,
contentW : this.m_dDocumentWidth
};
var settings = new AscCommon.ScrollSettings();
settings.screenW = this.m_oEditor.HtmlElement.width;
settings.screenH = this.m_oEditor.HtmlElement.height;
settings.vscrollStep = 45;
settings.hscrollStep = 45;
settings.contentH = this.m_dDocumentHeight;
settings.contentW = this.m_dDocumentWidth;
if (this.m_bIsRuler)
{
......@@ -2774,13 +2766,21 @@ function CEditorPage(api)
{
settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW);
settings.screenH = AscCommon.AscBrowser.convertToRetinaValue(settings.screenH);
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;
if (this.m_bIsHorScrollVisible)
{
if (this.m_oScrollHor_)
this.m_oScrollHor_.Repos(settings, true, undefined);//unbind("scrollhorizontal")
else
......@@ -2803,9 +2803,9 @@ function CEditorPage(api)
this.m_oScrollHorApi = this.m_oScrollHor_;
}
settings.alwaysVisible = undefined;
}
settings = this.CreateScrollSettings();
if (this.m_oScrollVer_)
{
this.m_oScrollVer_.Repos(settings, undefined, true);//unbind("scrollvertical")
......@@ -2813,9 +2813,7 @@ function CEditorPage(api)
else
{
this.m_oScrollVer_ = new AscCommon.ScrollObject("id_vertical_scroll",
settings
);
this.m_oScrollVer_ = new AscCommon.ScrollObject("id_vertical_scroll", settings);
this.m_oScrollVer_.onLockMouse = function(evt)
{
......
......@@ -830,7 +830,7 @@ function CEditorPage(api)
};
}
}
}
};
this.onButtonRulersClick = function()
{
......@@ -2450,7 +2450,7 @@ function CEditorPage(api)
global_keyboardEvent.CtrlKey = false;
global_keyboardEvent.ShiftKey = false;
global_keyboardEvent.AltGr = false;
}
};
this.onKeyPress = function(e)
{
if (AscCommon.g_clipboardBase.IsWorking())
......@@ -2576,29 +2576,30 @@ function CEditorPage(api)
}
};
this.UpdateScrolls = function()
this.CreateScrollSettings = function()
{
if (window["NATIVE_EDITOR_ENJINE"])
return;
var settings = {
showArrows : true,
animateScroll : false,
// scrollBackgroundColor: GlobalSkin.BackgroundScroll,
// scrollerColor:"#EDEDED",
screenW : this.m_oEditor.HtmlElement.width,
screenH : this.m_oEditor.HtmlElement.height,
vscrollStep : 45,
hscrollStep : 45,
isNeedInvertOnActive : GlobalSkin.isNeedInvertOnActive
};
var settings = new AscCommon.ScrollSettings();
settings.screenW = this.m_oEditor.HtmlElement.width;
settings.screenH = this.m_oEditor.HtmlElement.height;
settings.vscrollStep = 45;
settings.hscrollStep = 45;
settings.isNeedInvertOnActive = GlobalSkin.isNeedInvertOnActive;
if (this.bIsRetinaSupport)
{
settings.screenW = AscCommon.AscBrowser.convertToRetinaValue(settings.screenW);
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_)
this.m_oScrollHor_.Repos(settings, this.m_bIsHorScrollVisible);
else
......@@ -2609,18 +2610,19 @@ function CEditorPage(api)
{
AscCommon.check_MouseDownEvent(evt, true);
global_mouseEvent.LockMouse();
}
};
this.m_oScrollHor_.offLockMouse = function(evt)
{
AscCommon.check_MouseUpEvent(evt);
}
};
this.m_oScrollHor_.bind("scrollhorizontal", function(evt)
{
oThis.horizontalScroll(this, evt.scrollD, evt.maxScrollX);
})
});
this.m_oScrollHorApi = this.m_oScrollHor_;
}
settings = this.CreateScrollSettings();
if (this.m_oScrollVer_)
{
this.m_oScrollVer_.Repos(settings, undefined, true);
......@@ -2633,11 +2635,11 @@ function CEditorPage(api)
{
AscCommon.check_MouseDownEvent(evt, true);
global_mouseEvent.LockMouse();
}
};
this.m_oScrollVer_.offLockMouse = function(evt)
{
AscCommon.check_MouseUpEvent(evt);
}
};
this.m_oScrollVer_.bind("scrollvertical", function(evt)
{
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