BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
09738ad0
Commit
09738ad0
authored
Dec 21, 2016
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `get(0)` instead of direct array index access
parent
dbd21446
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
build.js
app/assets/javascripts/build.js
+8
-8
No files found.
app/assets/javascripts/build.js
View file @
09738ad0
...
@@ -131,7 +131,7 @@
...
@@ -131,7 +131,7 @@
// but never scrolled a page
// but never scrolled a page
if
(
!
this
.
$scrollTopBtn
.
is
(
':visible'
)
&&
if
(
!
this
.
$scrollTopBtn
.
is
(
':visible'
)
&&
!
this
.
$scrollBottomBtn
.
is
(
':visible'
)
&&
!
this
.
$scrollBottomBtn
.
is
(
':visible'
)
&&
!
gl
.
utils
.
isInViewport
(
this
.
$downBuildTrace
[
0
]
))
{
!
gl
.
utils
.
isInViewport
(
this
.
$downBuildTrace
.
get
(
0
)
))
{
this
.
$scrollBottomBtn
.
show
();
this
.
$scrollBottomBtn
.
show
();
}
}
};
};
...
@@ -158,12 +158,12 @@
...
@@ -158,12 +158,12 @@
// - Show Bottom Arrow button
// - Show Bottom Arrow button
// - Disable Autoscroll and hide indicator (when build is running)
// - Disable Autoscroll and hide indicator (when build is running)
Build
.
prototype
.
initScrollMonitor
=
function
()
{
Build
.
prototype
.
initScrollMonitor
=
function
()
{
if
(
!
gl
.
utils
.
isInViewport
(
this
.
$upBuildTrace
[
0
])
&&
!
gl
.
utils
.
isInViewport
(
this
.
$downBuildTrace
[
0
]
))
{
// User is somewhere in middle of Build Log
if
(
!
gl
.
utils
.
isInViewport
(
this
.
$upBuildTrace
.
get
(
0
))
&&
!
gl
.
utils
.
isInViewport
(
this
.
$downBuildTrace
.
get
(
0
)
))
{
// User is somewhere in middle of Build Log
this
.
$scrollTopBtn
.
show
();
this
.
$scrollTopBtn
.
show
();
if
(
this
.
buildStatus
===
'success'
||
this
.
buildStatus
===
'failed'
)
{
// Check if Build is completed
if
(
this
.
buildStatus
===
'success'
||
this
.
buildStatus
===
'failed'
)
{
// Check if Build is completed
this
.
$scrollBottomBtn
.
show
();
this
.
$scrollBottomBtn
.
show
();
}
else
if
(
this
.
$buildRefreshAnimation
.
is
(
':visible'
)
&&
!
gl
.
utils
.
isInViewport
(
this
.
$buildRefreshAnimation
[
0
]
))
{
}
else
if
(
this
.
$buildRefreshAnimation
.
is
(
':visible'
)
&&
!
gl
.
utils
.
isInViewport
(
this
.
$buildRefreshAnimation
.
get
(
0
)
))
{
this
.
$scrollBottomBtn
.
show
();
this
.
$scrollBottomBtn
.
show
();
}
else
{
}
else
{
this
.
$scrollBottomBtn
.
hide
();
this
.
$scrollBottomBtn
.
hide
();
...
@@ -177,21 +177,21 @@
...
@@ -177,21 +177,21 @@
this
.
$autoScrollContainer
.
css
({
top
:
this
.
$body
.
outerHeight
()
-
75
}).
fadeIn
(
100
);
this
.
$autoScrollContainer
.
css
({
top
:
this
.
$body
.
outerHeight
()
-
75
}).
fadeIn
(
100
);
this
.
$autoScrollStatusText
.
addClass
(
'animate'
);
this
.
$autoScrollStatusText
.
addClass
(
'animate'
);
}
}
}
else
if
(
gl
.
utils
.
isInViewport
(
this
.
$upBuildTrace
[
0
])
&&
!
gl
.
utils
.
isInViewport
(
this
.
$downBuildTrace
[
0
]
))
{
// User is at Top of Build Log
}
else
if
(
gl
.
utils
.
isInViewport
(
this
.
$upBuildTrace
.
get
(
0
))
&&
!
gl
.
utils
.
isInViewport
(
this
.
$downBuildTrace
.
get
(
0
)
))
{
// User is at Top of Build Log
this
.
$scrollTopBtn
.
hide
();
this
.
$scrollTopBtn
.
hide
();
this
.
$scrollBottomBtn
.
show
();
this
.
$scrollBottomBtn
.
show
();
this
.
$autoScrollContainer
.
hide
();
this
.
$autoScrollContainer
.
hide
();
this
.
$autoScrollStatusText
.
removeClass
(
'animate'
);
this
.
$autoScrollStatusText
.
removeClass
(
'animate'
);
}
else
if
((
!
gl
.
utils
.
isInViewport
(
this
.
$upBuildTrace
[
0
])
&&
gl
.
utils
.
isInViewport
(
this
.
$downBuildTrace
[
0
]
))
||
}
else
if
((
!
gl
.
utils
.
isInViewport
(
this
.
$upBuildTrace
.
get
(
0
))
&&
gl
.
utils
.
isInViewport
(
this
.
$downBuildTrace
.
get
(
0
)
))
||
(
this
.
$buildRefreshAnimation
.
is
(
':visible'
)
&&
gl
.
utils
.
isInViewport
(
this
.
$buildRefreshAnimation
[
0
]
)))
{
// User is at Bottom of Build Log
(
this
.
$buildRefreshAnimation
.
is
(
':visible'
)
&&
gl
.
utils
.
isInViewport
(
this
.
$buildRefreshAnimation
.
get
(
0
)
)))
{
// User is at Bottom of Build Log
this
.
$scrollTopBtn
.
show
();
this
.
$scrollTopBtn
.
show
();
this
.
$scrollBottomBtn
.
hide
();
this
.
$scrollBottomBtn
.
hide
();
// Show and Reposition Autoscroll Status Indicator
// Show and Reposition Autoscroll Status Indicator
this
.
$autoScrollContainer
.
css
({
top
:
this
.
$body
.
outerHeight
()
-
75
}).
fadeIn
(
100
);
this
.
$autoScrollContainer
.
css
({
top
:
this
.
$body
.
outerHeight
()
-
75
}).
fadeIn
(
100
);
this
.
$autoScrollStatusText
.
addClass
(
'animate'
);
this
.
$autoScrollStatusText
.
addClass
(
'animate'
);
}
else
if
(
gl
.
utils
.
isInViewport
(
this
.
$upBuildTrace
[
0
])
&&
gl
.
utils
.
isInViewport
(
this
.
$downBuildTrace
[
0
]
))
{
// Build Log height is small
}
else
if
(
gl
.
utils
.
isInViewport
(
this
.
$upBuildTrace
.
get
(
0
))
&&
gl
.
utils
.
isInViewport
(
this
.
$downBuildTrace
.
get
(
0
)
))
{
// Build Log height is small
this
.
$scrollTopBtn
.
hide
();
this
.
$scrollTopBtn
.
hide
();
this
.
$scrollBottomBtn
.
hide
();
this
.
$scrollBottomBtn
.
hide
();
...
@@ -202,7 +202,7 @@
...
@@ -202,7 +202,7 @@
if
(
this
.
buildStatus
===
"running"
||
this
.
buildStatus
===
"pending"
)
{
if
(
this
.
buildStatus
===
"running"
||
this
.
buildStatus
===
"pending"
)
{
// Check if Refresh Animation is in Viewport and enable Autoscroll, disable otherwise.
// Check if Refresh Animation is in Viewport and enable Autoscroll, disable otherwise.
this
.
$autoScrollStatus
.
data
(
"state"
,
gl
.
utils
.
isInViewport
(
this
.
$buildRefreshAnimation
[
0
]
)
?
'enabled'
:
'disabled'
);
this
.
$autoScrollStatus
.
data
(
"state"
,
gl
.
utils
.
isInViewport
(
this
.
$buildRefreshAnimation
.
get
(
0
)
)
?
'enabled'
:
'disabled'
);
}
}
};
};
...
...
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