Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CodeMirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Moritz Aurel Pascal Schubotz
CodeMirror
Commits
eb3eab70
Commit
eb3eab70
authored
8 years ago
by
Marijn Haverbeke
Browse files
Options
Downloads
Patches
Plain Diff
[simplescrollbars addon] Make sure thumb position is updated when size changes
Closes #3896
parent
59c4ebd9
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addon/scroll/simplescrollbars.js
+9
-6
9 additions, 6 deletions
addon/scroll/simplescrollbars.js
with
9 additions
and
6 deletions
addon/scroll/simplescrollbars.js
+
9
−
6
View file @
eb3eab70
...
...
@@ -59,10 +59,10 @@
CodeMirror
.
on
(
this
.
node
,
"
DOMMouseScroll
"
,
onWheel
);
}
Bar
.
prototype
.
setPos
=
function
(
pos
)
{
Bar
.
prototype
.
setPos
=
function
(
pos
,
force
)
{
if
(
pos
<
0
)
pos
=
0
;
if
(
pos
>
this
.
total
-
this
.
screen
)
pos
=
this
.
total
-
this
.
screen
;
if
(
pos
==
this
.
pos
)
return
false
;
if
(
!
force
&&
pos
==
this
.
pos
)
return
false
;
this
.
pos
=
pos
;
this
.
inner
.
style
[
this
.
orientation
==
"
horizontal
"
?
"
left
"
:
"
top
"
]
=
(
pos
*
(
this
.
size
/
this
.
total
))
+
"
px
"
;
...
...
@@ -76,9 +76,12 @@
var
minButtonSize
=
10
;
Bar
.
prototype
.
update
=
function
(
scrollSize
,
clientSize
,
barSize
)
{
this
.
screen
=
clientSize
;
this
.
total
=
scrollSize
;
this
.
size
=
barSize
;
var
sizeChanged
=
this
.
screen
!=
clientSize
||
this
.
total
!=
scrollSize
||
this
.
size
!=
barSize
if
(
sizeChanged
)
{
this
.
screen
=
clientSize
;
this
.
total
=
scrollSize
;
this
.
size
=
barSize
;
}
var
buttonSize
=
this
.
screen
*
(
this
.
size
/
this
.
total
);
if
(
buttonSize
<
minButtonSize
)
{
...
...
@@ -87,7 +90,7 @@
}
this
.
inner
.
style
[
this
.
orientation
==
"
horizontal
"
?
"
width
"
:
"
height
"
]
=
buttonSize
+
"
px
"
;
this
.
setPos
(
this
.
pos
);
this
.
setPos
(
this
.
pos
,
sizeChanged
);
};
function
SimpleScrollbars
(
cls
,
place
,
scroll
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment