Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
02d7f99f
Commit
02d7f99f
authored
Oct 19, 2017
by
Alexander Trofimov
Committed by
GitHub
Oct 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #189 from ONLYOFFICE/feature/refactoring-scroll
Feature/refactoring scroll
parents
6fec0fb1
6f3df233
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1931 additions
and
1954 deletions
+1931
-1954
cell/view/EventsController.js
cell/view/EventsController.js
+16
-11
common/browser.js
common/browser.js
+1
-1
common/scroll.js
common/scroll.js
+1821
-1840
slide/Drawing/DrawingDocument.js
slide/Drawing/DrawingDocument.js
+49
-58
slide/Drawing/HtmlPage.js
slide/Drawing/HtmlPage.js
+20
-22
word/Drawing/HtmlPage.js
word/Drawing/HtmlPage.js
+24
-22
No files found.
cell/view/EventsController.js
View file @
02d7f99f
...
...
@@ -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
.
wheelScrollLines
V
/
3
));
self
.
scrollVertical
(
deltaY
,
event
);
}
self
.
_onMouseMove
(
event
);
...
...
common/browser.js
View file @
02d7f99f
...
...
@@ -209,5 +209,5 @@ AscBrowser.convertToRetinaValue = function(value, isScale)
//--------------------------------------------------------export----------------------------------------------------
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
window
[
'
AscCommon
'
].
AscBrowser
=
AscBrowser
;
// ToDo убрать window['AscBrowser']
window
[
'
AscCommon
'
].
AscBrowser
=
AscBrowser
;
})(
window
);
common/scroll.js
View file @
02d7f99f
...
...
@@ -38,8 +38,7 @@
*/
function
(
window
,
undefined
)
{
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
var
AscCommon
=
window
[
'
AscCommon
'
];
var
AscBrowser
=
window
[
'
AscCommon
'
].
AscBrowser
;
var
debug
=
false
;
...
...
@@ -123,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
;
...
...
@@ -155,7 +154,7 @@ function CArrowDrawer( settings ) {
this
.
ImageRight
=
null
;
this
.
ImageBottom
=
null
;
this
.
IsNeedInvertOnActive
=
settings
&&
settings
.
isNeedInvertOnActive
?
settings
.
isNeedInvertOnActive
:
fals
e
;
this
.
IsNeedInvertOnActive
=
settings
.
isNeedInvertOnActiv
e
;
this
.
lastArrowStatus1
=
-
1
;
this
.
lastArrowStatus2
=
-
1
;
...
...
@@ -177,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
)
{
...
...
@@ -1479,87 +1478,71 @@ function _HEXTORGB_( colorHEX ) {
}
}
/**
/**
* @constructor
*/
function
ScrollObject
(
elemID
,
settings
,
dbg
)
{
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
;
this
.
scrollerMaxWidth
=
99999
;
this
.
initialDelay
=
300
;
this
.
arrowRepeatFreq
=
50
;
this
.
trackClickRepeatFreq
=
70
;
this
.
scrollPagePercent
=
1
.
/
8
;
this
.
arrowDim
=
13
;
this
.
marginScroller
=
4
;
this
.
scrollerColor
=
"
#f1f1f1
"
;
this
.
scrollerColorOver
=
"
#cfcfcf
"
;
this
.
scrollerColorLayerOver
=
"
#cfcfcf
"
;
this
.
scrollerColorActive
=
"
#ADADAD
"
;
this
.
scrollBackgroundColor
=
"
#f4f4f4
"
;
this
.
scrollBackgroundColorHover
=
"
#f4f4f4
"
;
this
.
scrollBackgroundColorActive
=
"
#f4f4f4
"
;
this
.
strokeStyleNone
=
"
#cfcfcf
"
;
this
.
strokeStyleOver
=
"
#cfcfcf
"
;
this
.
strokeStyleActive
=
"
#ADADAD
"
;
this
.
vscrollStep
=
10
;
this
.
hscrollStep
=
10
;
this
.
wheelScrollLines
=
1
;
this
.
arrowColor
=
"
#ADADAD
"
;
this
.
arrowBorderColor
=
"
#cfcfcf
"
;
this
.
arrowBackgroundColor
=
"
#F1F1F1
"
;
this
.
arrowStableColor
=
"
#ADADAD
"
;
this
.
arrowStableBorderColor
=
"
#cfcfcf
"
;
this
.
arrowStableBackgroundColor
=
"
#F1F1F1
"
;
this
.
arrowOverColor
=
"
#f1f1f1
"
;
this
.
arrowOverBorderColor
=
"
#cfcfcf
"
;
this
.
arrowOverBackgroundColor
=
"
#cfcfcf
"
;
this
.
arrowActiveColor
=
"
#f1f1f1
"
;
this
.
arrowActiveBorderColor
=
"
#ADADAD
"
;
this
.
arrowActiveBackgroundColor
=
"
#ADADAD
"
;
this
.
fadeInFadeOutDelay
=
20
;
this
.
piperColor
=
"
#cfcfcf
"
;
this
.
piperColorHover
=
"
#f1f1f1
"
;
this
.
arrowSizeW
=
13
;
this
.
arrowSizeH
=
13
;
this
.
cornerRadius
=
0
;
this
.
slimScroll
=
false
;
this
.
alwaysVisible
=
false
;
this
.
isNeedInvertOnActive
=
false
;
}
/**
* @constructor
*/
function
ScrollObject
(
elemID
,
settings
,
dbg
)
{
if
(
dbg
)
debug
=
dbg
;
var
that
=
this
;
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
;
...
...
@@ -1623,7 +1606,7 @@ function ScrollObject( elemID, settings, dbg ) {
this
.
startColorFadeOutStart
=
_HEXTORGB_
(
this
.
settings
.
scrollerColorOver
).
R
;
this
.
startColorFadeInOutStart
=
-
1
;
this
.
IsRetina
=
AscCommon
.
AscBrowser
.
isRetina
;
this
.
IsRetina
=
AscBrowser
.
isRetina
;
this
.
piperImgVert
=
[
document
.
createElement
(
'
canvas
'
),
document
.
createElement
(
'
canvas
'
)];
this
.
piperImgHor
=
[
document
.
createElement
(
'
canvas
'
),
document
.
createElement
(
'
canvas
'
)];
...
...
@@ -1691,10 +1674,9 @@ function ScrollObject( elemID, settings, dbg ) {
}
this
.
_init
(
elemID
);
}
ScrollObject
.
prototype
=
{
}
_init
:
function
(
elemID
)
{
ScrollObject
.
prototype
.
_init
=
function
(
elemID
)
{
if
(
!
elemID
)
return
false
;
var
holder
=
document
.
getElementById
(
elemID
);
...
...
@@ -1758,15 +1740,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
);
...
...
@@ -1779,8 +1761,8 @@ ScrollObject.prototype = {
this
.
_draw
();
return
true
;
},
getMousePosition
:
function
(
evt
)
{
};
ScrollObject
.
prototype
.
getMousePosition
=
function
(
evt
)
{
// get canvas position
var
obj
=
this
.
canvas
;
var
top
=
0
;
...
...
@@ -1792,15 +1774,15 @@ ScrollObject.prototype = {
}
// return relative mouse position
var
mouseX
=
((
evt
.
clientX
*
AscCommon
.
AscBrowser
.
zoom
)
>>
0
)
-
left
+
window
.
pageXOffset
;
var
mouseY
=
((
evt
.
clientY
*
AscCommon
.
AscBrowser
.
zoom
)
>>
0
)
-
top
+
window
.
pageYOffset
;
var
mouseX
=
((
evt
.
clientX
*
AscBrowser
.
zoom
)
>>
0
)
-
left
+
window
.
pageXOffset
;
var
mouseY
=
((
evt
.
clientY
*
AscBrowser
.
zoom
)
>>
0
)
-
top
+
window
.
pageYOffset
;
return
{
x
:
mouseX
,
y
:
mouseY
};
},
RecalcScroller
:
function
(
startpos
)
{
};
ScrollObject
.
prototype
.
RecalcScroller
=
function
(
startpos
)
{
if
(
this
.
isVerticalScroll
)
{
if
(
this
.
settings
.
showArrows
)
{
this
.
verticalTrackHeight
=
this
.
canvasH
-
this
.
arrowPosition
*
2
;
...
...
@@ -1841,7 +1823,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
);
...
...
@@ -1851,19 +1833,18 @@ ScrollObject.prototype = {
this
.
dragMaxX
=
this
.
canvasW
-
this
.
arrowPosition
-
this
.
scroller
.
w
;
this
.
dragMinX
=
this
.
arrowPosition
;
}
},
Repos
:
function
(
settings
,
bIsHorAttack
,
bIsVerAttack
)
{
if
(
this
.
IsRetina
!=
AscCommon
.
AscBrowser
.
isRetina
)
};
ScrollObject
.
prototype
.
Repos
=
function
(
settings
,
bIsHorAttack
,
bIsVerAttack
)
{
if
(
this
.
IsRetina
!=
AscBrowser
.
isRetina
)
{
this
.
IsRetina
=
AscCommon
.
AscBrowser
.
isRetina
;
this
.
IsRetina
=
AscBrowser
.
isRetina
;
this
.
ArrowDrawer
.
InitSize
(
this
.
settings
.
arrowSizeH
,
this
.
settings
.
arrowSizeW
,
this
.
IsRetina
);
}
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
)
...
...
@@ -1929,8 +1910,8 @@ ScrollObject.prototype = {
this
.
_drawArrow
();
this
.
_draw
();
},
Reinit
:
function
(
settings
,
pos
)
{
};
ScrollObject
.
prototype
.
Reinit
=
function
(
settings
,
pos
)
{
this
.
_setDimension
(
this
.
canvas
.
parentNode
.
clientHeight
,
this
.
canvas
.
parentNode
.
clientWidth
);
this
.
maxScrollY
=
this
.
canvas
.
parentNode
.
firstElementChild
.
clientHeight
-
(
settings
.
screenH
||
this
.
canvas
.
parentNode
.
offsetHeight
)
>
0
?
this
.
canvas
.
parentNode
.
firstElementChild
.
clientHeight
-
(
settings
.
screenH
||
this
.
canvas
.
parentNode
.
offsetHeight
)
:
...
...
@@ -1958,8 +1939,8 @@ ScrollObject.prototype = {
this
.
reinit
=
false
;
this
.
_drawArrow
();
this
.
_draw
();
},
_scrollV
:
function
(
that
,
evt
,
pos
,
isTop
,
isBottom
,
bIsAttack
)
{
};
ScrollObject
.
prototype
.
_scrollV
=
function
(
that
,
evt
,
pos
,
isTop
,
isBottom
,
bIsAttack
)
{
if
(
!
this
.
isVerticalScroll
)
{
return
;
}
...
...
@@ -1975,8 +1956,8 @@ ScrollObject.prototype = {
evt
.
pos
=
pos
;
that
.
handleEvents
(
"
onscrollVEnd
"
,
evt
);
}
},
_correctScrollV
:
function
(
that
,
yPos
)
{
};
ScrollObject
.
prototype
.
_correctScrollV
=
function
(
that
,
yPos
)
{
if
(
!
this
.
isVerticalScroll
)
return
null
;
...
...
@@ -1988,8 +1969,8 @@ ScrollObject.prototype = {
return
events
[
0
].
handler
.
apply
(
that
,
[
yPos
]
);
}
return
null
;
},
_correctScrollByYDelta
:
function
(
that
,
delta
)
{
};
ScrollObject
.
prototype
.
_correctScrollByYDelta
=
function
(
that
,
delta
)
{
if
(
!
this
.
isVerticalScroll
)
return
null
;
...
...
@@ -2001,8 +1982,8 @@ ScrollObject.prototype = {
return
events
[
0
].
handler
.
apply
(
that
,
[
delta
]
);
}
return
null
;
},
_scrollH
:
function
(
that
,
evt
,
pos
,
isTop
,
isBottom
)
{
};
ScrollObject
.
prototype
.
_scrollH
=
function
(
that
,
evt
,
pos
,
isTop
,
isBottom
)
{
if
(
!
this
.
isHorizontalScroll
)
{
return
;
}
...
...
@@ -2020,8 +2001,8 @@ ScrollObject.prototype = {
that
.
handleEvents
(
"
onscrollHEnd
"
,
evt
);
}
},
scrollByY
:
function
(
delta
,
bIsAttack
)
{
};
ScrollObject
.
prototype
.
scrollByY
=
function
(
delta
,
bIsAttack
)
{
if
(
!
this
.
isVerticalScroll
)
{
return
;
}
...
...
@@ -2073,8 +2054,8 @@ ScrollObject.prototype = {
if
(
vend
)
{
this
.
moveble
=
false
;
}
},
scrollToY
:
function
(
destY
)
{
};
ScrollObject
.
prototype
.
scrollToY
=
function
(
destY
)
{
if
(
!
this
.
isVerticalScroll
)
{
return
;
}
...
...
@@ -2093,8 +2074,8 @@ ScrollObject.prototype = {
this
.
scroller
.
y
=
Math
.
round
(
this
.
scroller
.
y
);
this
.
_scrollV
(
this
,
{},
destY
,
false
,
false
);
},
scrollByX
:
function
(
delta
)
{
};
ScrollObject
.
prototype
.
scrollByX
=
function
(
delta
)
{
if
(
!
this
.
isHorizontalScroll
)
{
return
;
}
...
...
@@ -2137,8 +2118,8 @@ ScrollObject.prototype = {
if
(
hend
)
{
this
.
moveble
=
true
;
}
},
scrollToX
:
function
(
destX
)
{
};
ScrollObject
.
prototype
.
scrollToX
=
function
(
destX
)
{
if
(
!
this
.
isHorizontalScroll
)
{
return
;
}
...
...
@@ -2157,17 +2138,17 @@ ScrollObject.prototype = {
this
.
scroller
.
x
=
Math
.
round
(
this
.
scroller
.
x
);
this
.
_scrollH
(
this
,
{},
destX
,
false
,
false
);
},
scrollTo
:
function
(
destX
,
destY
)
{
};
ScrollObject
.
prototype
.
scrollTo
=
function
(
destX
,
destY
)
{
this
.
scrollToX
(
destX
);
this
.
scrollToY
(
destY
);
},
scrollBy
:
function
(
deltaX
,
deltaY
)
{
};
ScrollObject
.
prototype
.
scrollBy
=
function
(
deltaX
,
deltaY
)
{
this
.
scrollByX
(
deltaX
);
this
.
scrollByY
(
deltaY
);
},
};
roundRect
:
function
(
x
,
y
,
width
,
height
,
radius
)
{
ScrollObject
.
prototype
.
roundRect
=
function
(
x
,
y
,
width
,
height
,
radius
)
{
if
(
typeof
radius
===
"
undefined
"
)
{
radius
=
1
;
}
...
...
@@ -2182,12 +2163,12 @@ ScrollObject.prototype = {
this
.
context
.
lineTo
(
x
,
y
+
radius
);
this
.
context
.
quadraticCurveTo
(
x
,
y
,
x
+
radius
,
y
);
this
.
context
.
closePath
();
},
};
_clearContent
:
function
()
{
ScrollObject
.
prototype
.
_clearContent
=
function
()
{
this
.
context
.
clearRect
(
0
,
0
,
this
.
canvasW
,
this
.
canvasH
);
},
_draw
:
function
()
{
};
ScrollObject
.
prototype
.
_draw
=
function
()
{
// очистку не нужно делать - если потом рисовать рект такой же
//this._clearContent();
var
piperImgIndex
=
0
,
that
=
this
,
...
...
@@ -2251,7 +2232,7 @@ ScrollObject.prototype = {
}
}
ctx_piperImg
.
putImageData
(
_data
,
0
,
0
)
ctx_piperImg
.
putImageData
(
_data
,
0
,
0
);
img
=
that
.
piperImgHor
[
0
];
}
...
...
@@ -2478,11 +2459,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
;
}
...
...
@@ -2492,7 +2473,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
;
}
...
...
@@ -2618,20 +2599,20 @@ ScrollObject.prototype = {
this
.
lastScrollerStatus
=
this
.
scrollerStatus
;
},
};
_checkPiperImagesV
:
function
()
{
ScrollObject
.
prototype
.
_checkPiperImagesV
=
function
()
{
if
(
this
.
isVerticalScroll
&&
this
.
maxScrollY
!=
0
&&
this
.
scroller
.
h
>=
13
)
return
true
;
return
false
;
},
_checkPiperImagesH
:
function
()
{
};
ScrollObject
.
prototype
.
_checkPiperImagesH
=
function
()
{
if
(
this
.
isHorizontalScroll
&&
this
.
maxScrollX
!=
0
&&
this
.
scroller
.
w
>=
13
)
return
true
;
return
false
;
},
};
_drawArrow
:
function
(
type
)
{
ScrollObject
.
prototype
.
_drawArrow
=
function
(
type
)
{
if
(
this
.
settings
.
showArrows
)
{
var
w
=
this
.
canvasW
;
var
h
=
this
.
canvasH
;
...
...
@@ -2765,9 +2746,9 @@ ScrollObject.prototype = {
}
}
}
},
};
_setDimension
:
function
(
h
,
w
)
{
ScrollObject
.
prototype
.
_setDimension
=
function
(
h
,
w
)
{
if
(
w
==
this
.
canvasW
&&
h
==
this
.
canvasH
)
return
;
...
...
@@ -2790,8 +2771,8 @@ ScrollObject.prototype = {
this
.
context
.
setTransform
(
2
,
0
,
0
,
2
,
0
,
0
);
}
},
_setScrollerHW
:
function
()
{
};
ScrollObject
.
prototype
.
_setScrollerHW
=
function
()
{
if
(
this
.
isVerticalScroll
)
{
this
.
scroller
.
x
=
1
;
//0;
this
.
scroller
.
w
=
this
.
canvasW
-
1
;
...
...
@@ -2804,8 +2785,8 @@ ScrollObject.prototype = {
if
(
this
.
settings
.
showArrows
)
this
.
ArrowDrawer
.
InitSize
(
this
.
settings
.
arrowSizeH
,
this
.
settings
.
arrowSizeW
,
this
.
IsRetina
);
}
},
_MouseHoverOnScroller
:
function
(
mp
)
{
};
ScrollObject
.
prototype
.
_MouseHoverOnScroller
=
function
(
mp
)
{
if
(
mp
.
x
>=
this
.
scroller
.
x
&&
mp
.
x
<=
this
.
scroller
.
x
+
this
.
scroller
.
w
&&
mp
.
y
>=
this
.
scroller
.
y
&&
mp
.
y
<=
this
.
scroller
.
y
+
this
.
scroller
.
h
)
{
return
true
;
...
...
@@ -2813,8 +2794,8 @@ ScrollObject.prototype = {
else
{
return
false
;
}
},
_MouseHoverOnArrowUp
:
function
(
mp
)
{
};
ScrollObject
.
prototype
.
_MouseHoverOnArrowUp
=
function
(
mp
)
{
if
(
this
.
isVerticalScroll
)
{
if
(
mp
.
x
>=
0
&&
...
...
@@ -2837,8 +2818,8 @@ ScrollObject.prototype = {
}
else
return
false
;
}
},
_MouseHoverOnArrowDown
:
function
(
mp
)
{
};
ScrollObject
.
prototype
.
_MouseHoverOnArrowDown
=
function
(
mp
)
{
if
(
this
.
isVerticalScroll
)
{
if
(
mp
.
x
>=
0
&&
...
...
@@ -2861,9 +2842,9 @@ ScrollObject.prototype = {
}
else
return
false
;
}
},
};
_arrowDownMouseDown
:
function
()
{
ScrollObject
.
prototype
.
_arrowDownMouseDown
=
function
()
{
var
that
=
this
,
scrollTimeout
,
isFirst
=
true
,
doScroll
=
function
()
{
if
(
that
.
isVerticalScroll
)
...
...
@@ -2879,8 +2860,8 @@ ScrollObject.prototype = {
scrollTimeout
&&
clearTimeout
(
scrollTimeout
);
scrollTimeout
=
null
;
}
);
},
_arrowUpMouseDown
:
function
()
{
};
ScrollObject
.
prototype
.
_arrowUpMouseDown
=
function
()
{
var
that
=
this
,
scrollTimeout
,
isFirst
=
true
,
doScroll
=
function
()
{
if
(
that
.
isVerticalScroll
)
...
...
@@ -2896,26 +2877,26 @@ ScrollObject.prototype = {
scrollTimeout
&&
clearTimeout
(
scrollTimeout
);
scrollTimeout
=
null
;
}
)
},
};
getCurScrolledX
:
function
()
{
ScrollObject
.
prototype
.
getCurScrolledX
=
function
()
{
return
this
.
scrollHCurrentX
;
},
getCurScrolledY
:
function
()
{
};
ScrollObject
.
prototype
.
getCurScrolledY
=
function
()
{
return
this
.
scrollVCurrentY
;
},
getMaxScrolledY
:
function
()
{
};
ScrollObject
.
prototype
.
getMaxScrolledY
=
function
()
{
return
this
.
maxScrollY
;
},
getMaxScrolledX
:
function
()
{
};
ScrollObject
.
prototype
.
getMaxScrolledX
=
function
()
{
return
this
.
maxScrollX
;
},
getIsLockedMouse
:
function
()
{
};
ScrollObject
.
prototype
.
getIsLockedMouse
=
function
()
{
return
(
this
.
that
.
mouseDownArrow
||
this
.
that
.
mouseDown
);
},
};
/************************************************************************/
/*events*/
evt_mousemove
:
function
(
e
)
{
ScrollObject
.
prototype
.
evt_mousemove
=
function
(
e
)
{
var
arrowStat
=
ArrowStatus
.
arrowHover
;
var
evt
=
e
||
window
.
event
;
...
...
@@ -3038,8 +3019,8 @@ ScrollObject.prototype = {
this
.
that
.
_draw
();
}
},
evt_mouseout
:
function
(
e
)
{
};
ScrollObject
.
prototype
.
evt_mouseout
=
function
(
e
)
{
var
evt
=
e
||
window
.
event
;
...
...
@@ -3057,13 +3038,13 @@ ScrollObject.prototype = {
this
.
that
.
_draw
();
}
},
evt_mouseover
:
function
(
e
)
{
};
ScrollObject
.
prototype
.
evt_mouseover
=
function
(
e
)
{
this
.
that
.
mouseover
=
true
;
},
evt_mouseup
:
function
(
e
)
{
};
ScrollObject
.
prototype
.
evt_mouseup
=
function
(
e
)
{
var
evt
=
e
||
window
.
event
;
// prevent pointer events on all iframes (while only plugin!)
...
...
@@ -3110,8 +3091,8 @@ ScrollObject.prototype = {
this
.
that
.
offLockMouse
(
evt
);
}
this
.
that
.
handleEvents
(
"
onmouseup
"
,
evt
);
},
evt_mousedown
:
function
(
e
)
{
};
ScrollObject
.
prototype
.
evt_mousedown
=
function
(
e
)
{
var
evt
=
e
||
window
.
event
;
// prevent pointer events on all iframes (while only plugin!)
...
...
@@ -3254,8 +3235,8 @@ ScrollObject.prototype = {
}
}
}
},
evt_mousewheel
:
function
(
e
)
{
};
ScrollObject
.
prototype
.
evt_mousewheel
=
function
(
e
)
{
var
evt
=
e
||
window
.
event
;
/* if ( evt.preventDefault )
evt.preventDefault();
...
...
@@ -3277,8 +3258,8 @@ ScrollObject.prototype = {
this
.
that
.
scroller
.
y
=
this
.
that
.
canvasH
-
this
.
that
.
arrowPosition
-
this
.
that
.
scroller
.
h
;
}
this
.
that
.
scrollByY
(
delta
)
},
evt_click
:
function
(
e
)
{
};
ScrollObject
.
prototype
.
evt_click
=
function
(
e
)
{
var
evt
=
e
||
window
.
event
;
var
mousePos
=
this
.
that
.
getMousePosition
(
evt
);
if
(
this
.
that
.
isHorizontalScroll
)
{
...
...
@@ -3307,11 +3288,11 @@ ScrollObject.prototype = {
}
}
}
},
};
/************************************************************************/
/*for events*/
bind
:
function
(
typesStr
,
handler
)
{
ScrollObject
.
prototype
.
bind
=
function
(
typesStr
,
handler
)
{
var
types
=
typesStr
.
split
(
"
"
);
/*
* loop through types and attach event listeners to
...
...
@@ -3334,8 +3315,8 @@ ScrollObject.prototype = {
handler
:
handler
}
);
}
},
unbind
:
function
(
typesStr
)
{
};
ScrollObject
.
prototype
.
unbind
=
function
(
typesStr
)
{
var
types
=
typesStr
.
split
(
"
"
);
for
(
var
n
=
0
;
n
<
types
.
length
;
n
++
)
{
...
...
@@ -3361,8 +3342,8 @@ ScrollObject.prototype = {
this
.
eventListeners
[
baseEvent
]
=
undefined
;
}
}
},
handleEvents
:
function
(
eventType
,
evt
,
p
)
{
};
ScrollObject
.
prototype
.
handleEvents
=
function
(
eventType
,
evt
,
p
)
{
var
that
=
this
;
// generic events handler
function
handle
(
obj
)
{
...
...
@@ -3381,9 +3362,9 @@ ScrollObject.prototype = {
* by layer events
*/
handle
(
that
);
}
};
};
//---------------------------------------------------------export---------------------------------------------------
window
[
"
AscCommon
"
].
ScrollSettings
=
ScrollSettings
;
window
[
"
AscCommon
"
].
ScrollObject
=
ScrollObject
;
})(
window
);
slide/Drawing/DrawingDocument.js
View file @
02d7f99f
...
...
@@ -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
);
...
...
slide/Drawing/HtmlPage.js
View file @
02d7f99f
...
...
@@ -2747,23 +2747,15 @@ function CEditorPage(api)
}
};
this
.
UpdateScroll
s
=
function
()
this
.
CreateScrollSetting
s
=
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
)
{
...
...
word/Drawing/HtmlPage.js
View file @
02d7f99f
...
...
@@ -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
.
UpdateScroll
s
=
function
()
this
.
CreateScrollSetting
s
=
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment