Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
Boxiang Sun
gitlab-ce
Commits
7c636732
Commit
7c636732
authored
Dec 21, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use non cached variables to get scroll position because of the performance bar
parent
889c7081
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
app/assets/javascripts/job.js
app/assets/javascripts/job.js
+14
-10
No files found.
app/assets/javascripts/job.js
View file @
7c636732
...
...
@@ -96,14 +96,14 @@ export default class Job {
// eslint-disable-next-line class-methods-use-this
canScroll
()
{
return
this
.
$document
.
height
()
>
this
.
$window
.
height
();
return
$
(
document
).
height
()
>
$
(
window
)
.
height
();
}
toggleScroll
()
{
const
currentPosition
=
this
.
$document
.
scrollTop
();
const
scrollHeight
=
this
.
$document
.
height
();
const
currentPosition
=
$
(
document
)
.
scrollTop
();
const
scrollHeight
=
$
(
document
)
.
height
();
const
windowHeight
=
this
.
$window
.
height
();
const
windowHeight
=
$
(
window
)
.
height
();
if
(
this
.
canScroll
())
{
if
(
currentPosition
>
0
&&
(
scrollHeight
-
currentPosition
!==
windowHeight
))
{
...
...
@@ -127,18 +127,22 @@ export default class Job {
this
.
toggleDisableButton
(
this
.
$scrollBottomBtn
,
true
);
}
}
// eslint-disable-next-line class-methods-use-this
isScrolledToBottom
()
{
const
currentPosition
=
this
.
$document
.
scrollTop
();
const
scrollHeight
=
this
.
$document
.
height
();
const
$document
=
$
(
document
);
const
currentPosition
=
$document
.
scrollTop
();
const
scrollHeight
=
$document
.
height
();
const
windowHeight
=
$
(
window
).
height
();
const
windowHeight
=
this
.
$window
.
height
();
return
scrollHeight
-
currentPosition
===
windowHeight
;
}
// eslint-disable-next-line class-methods-use-this
scrollDown
()
{
this
.
$document
.
scrollTop
(
this
.
$document
.
height
());
const
$document
=
$
(
document
);
$document
.
scrollTop
(
$document
.
height
());
}
scrollToBottom
()
{
...
...
@@ -148,7 +152,7 @@ export default class Job {
}
scrollToTop
()
{
this
.
$document
.
scrollTop
(
0
);
$
(
document
)
.
scrollTop
(
0
);
this
.
hasBeenScrolled
=
true
;
this
.
toggleScroll
();
}
...
...
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