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
Léo-Paul Géneau
gitlab-ce
Commits
481040e2
Commit
481040e2
authored
Jun 09, 2017
by
Filipa Lacerda
Committed by
Phil Hughes
Jun 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove nicescroll from job trace
parent
2368ffd9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
48 deletions
+59
-48
app/assets/javascripts/build.js
app/assets/javascripts/build.js
+29
-23
app/assets/stylesheets/pages/builds.scss
app/assets/stylesheets/pages/builds.scss
+19
-9
app/views/projects/jobs/show.html.haml
app/views/projects/jobs/show.html.haml
+11
-16
No files found.
app/assets/javascripts/build.js
View file @
481040e2
...
@@ -20,6 +20,7 @@ window.Build = (function () {
...
@@ -20,6 +20,7 @@ window.Build = (function () {
this
.
$document
=
$
(
document
);
this
.
$document
=
$
(
document
);
this
.
logBytes
=
0
;
this
.
logBytes
=
0
;
this
.
scrollOffsetPadding
=
30
;
this
.
scrollOffsetPadding
=
30
;
this
.
hasBeenScrolled
=
false
;
this
.
updateDropdown
=
this
.
updateDropdown
.
bind
(
this
);
this
.
updateDropdown
=
this
.
updateDropdown
.
bind
(
this
);
this
.
getBuildTrace
=
this
.
getBuildTrace
.
bind
(
this
);
this
.
getBuildTrace
=
this
.
getBuildTrace
.
bind
(
this
);
...
@@ -62,6 +63,15 @@ window.Build = (function () {
...
@@ -62,6 +63,15 @@ window.Build = (function () {
.
off
(
'
click
'
)
.
off
(
'
click
'
)
.
on
(
'
click
'
,
this
.
scrollToBottom
.
bind
(
this
));
.
on
(
'
click
'
,
this
.
scrollToBottom
.
bind
(
this
));
const
scrollThrottled
=
_
.
throttle
(
this
.
toggleScroll
.
bind
(
this
),
100
);
this
.
$scrollContainer
.
off
(
'
scroll
'
)
.
on
(
'
scroll
'
,
()
=>
{
this
.
hasBeenScrolled
=
true
;
scrollThrottled
();
});
$
(
window
)
$
(
window
)
.
off
(
'
resize.build
'
)
.
off
(
'
resize.build
'
)
.
on
(
'
resize.build
'
,
_
.
throttle
(
this
.
sidebarOnResize
.
bind
(
this
),
100
));
.
on
(
'
resize.build
'
,
_
.
throttle
(
this
.
sidebarOnResize
.
bind
(
this
),
100
));
...
@@ -70,24 +80,15 @@ window.Build = (function () {
...
@@ -70,24 +80,15 @@ window.Build = (function () {
// eslint-disable-next-line
// eslint-disable-next-line
this
.
getBuildTrace
()
this
.
getBuildTrace
()
.
then
(()
=>
this
.
makeTraceScrollable
())
.
then
(()
=>
this
.
toggleScroll
())
.
then
(()
=>
this
.
scrollToBottom
());
.
then
(()
=>
{
if
(
!
this
.
hasBeenScrolled
)
{
this
.
verifyTopPosition
();
this
.
scrollToBottom
();
}
}
Build
.
prototype
.
makeTraceScrollable
=
function
()
{
this
.
$scrollContainer
.
niceScroll
({
cursorcolor
:
'
#fff
'
,
cursoropacitymin
:
1
,
cursorwidth
:
'
7px
'
,
railpadding
:
{
top
:
5
,
bottom
:
5
,
right
:
5
},
});
});
this
.
$scrollContainer
.
on
(
'
scroll
'
,
_
.
throttle
(
this
.
toggleScroll
.
bind
(
this
),
100
));
this
.
verifyTopPosition
();
}
this
.
toggleScroll
();
};
Build
.
prototype
.
canScroll
=
function
()
{
Build
.
prototype
.
canScroll
=
function
()
{
return
(
this
.
$scrollContainer
.
prop
(
'
scrollHeight
'
)
-
this
.
scrollOffsetPadding
)
>
this
.
$scrollContainer
.
height
();
return
(
this
.
$scrollContainer
.
prop
(
'
scrollHeight
'
)
-
this
.
scrollOffsetPadding
)
>
this
.
$scrollContainer
.
height
();
...
@@ -104,12 +105,11 @@ window.Build = (function () {
...
@@ -104,12 +105,11 @@ window.Build = (function () {
*
*
*/
*/
Build
.
prototype
.
toggleScroll
=
function
()
{
Build
.
prototype
.
toggleScroll
=
function
()
{
const
bottomScroll
=
this
.
$scrollContainer
.
scrollTop
()
+
const
currentPosition
=
this
.
$scrollContainer
.
scrollTop
();
this
.
scrollOffsetPadding
+
const
bottomScroll
=
currentPosition
+
this
.
$scrollContainer
.
innerHeight
();
this
.
$scrollContainer
.
height
();
if
(
this
.
canScroll
())
{
if
(
this
.
canScroll
())
{
if
(
this
.
$scrollContainer
.
scrollTop
()
===
0
)
{
if
(
currentPosition
===
0
)
{
this
.
toggleDisableButton
(
this
.
$scrollTopBtn
,
true
);
this
.
toggleDisableButton
(
this
.
$scrollTopBtn
,
true
);
this
.
toggleDisableButton
(
this
.
$scrollBottomBtn
,
false
);
this
.
toggleDisableButton
(
this
.
$scrollBottomBtn
,
false
);
}
else
if
(
bottomScroll
===
this
.
$scrollContainer
.
prop
(
'
scrollHeight
'
))
{
}
else
if
(
bottomScroll
===
this
.
$scrollContainer
.
prop
(
'
scrollHeight
'
))
{
...
@@ -123,12 +123,14 @@ window.Build = (function () {
...
@@ -123,12 +123,14 @@ window.Build = (function () {
};
};
Build
.
prototype
.
scrollToTop
=
function
()
{
Build
.
prototype
.
scrollToTop
=
function
()
{
this
.
$scrollContainer
.
getNiceScroll
(
0
).
doScrollTop
(
0
);
this
.
hasBeenScrolled
=
true
;
this
.
$scrollContainer
.
scrollTop
(
0
);
this
.
toggleScroll
();
this
.
toggleScroll
();
};
};
Build
.
prototype
.
scrollToBottom
=
function
()
{
Build
.
prototype
.
scrollToBottom
=
function
()
{
this
.
$scrollContainer
.
getNiceScroll
(
0
).
doScrollTo
(
this
.
$scrollContainer
.
prop
(
'
scrollHeight
'
));
this
.
hasBeenScrolled
=
true
;
this
.
$scrollContainer
.
scrollTop
(
this
.
$scrollContainer
.
prop
(
'
scrollHeight
'
));
this
.
toggleScroll
();
this
.
toggleScroll
();
};
};
...
@@ -216,7 +218,11 @@ window.Build = (function () {
...
@@ -216,7 +218,11 @@ window.Build = (function () {
Build
.
timeout
=
setTimeout
(()
=>
{
Build
.
timeout
=
setTimeout
(()
=>
{
//eslint-disable-next-line
//eslint-disable-next-line
this
.
getBuildTrace
()
this
.
getBuildTrace
()
.
then
(()
=>
this
.
scrollToBottom
());
.
then
(()
=>
{
if
(
!
this
.
hasBeenScrolled
)
{
this
.
scrollToBottom
();
}
});
},
4000
);
},
4000
);
}
else
{
}
else
{
this
.
$buildRefreshAnimation
.
remove
();
this
.
$buildRefreshAnimation
.
remove
();
...
@@ -253,7 +259,7 @@ window.Build = (function () {
...
@@ -253,7 +259,7 @@ window.Build = (function () {
this
.
verifyTopPosition
();
this
.
verifyTopPosition
();
if
(
this
.
$scrollContainer
.
getNiceScroll
(
0
))
{
if
(
this
.
canScroll
(
))
{
this
.
toggleScroll
();
this
.
toggleScroll
();
}
}
};
};
...
...
app/assets/stylesheets/pages/builds.scss
View file @
481040e2
...
@@ -71,7 +71,9 @@
...
@@ -71,7 +71,9 @@
height
:
35px
;
height
:
35px
;
display
:
flex
;
display
:
flex
;
justify-content
:
flex-end
;
justify-content
:
flex-end
;
border-bottom
:
1px
outset
$white-light
;
background
:
$gray-light
;
border
:
1px
solid
$gray-normal
;
color
:
$gl-text-color
;
.truncated-info
{
.truncated-info
{
margin
:
0
auto
;
margin
:
0
auto
;
...
@@ -82,7 +84,7 @@
...
@@ -82,7 +84,7 @@
}
}
.raw-link
{
.raw-link
{
color
:
inherit
;
color
:
$gl-text-color
;
margin-left
:
5px
;
margin-left
:
5px
;
text-decoration
:
underline
;
text-decoration
:
underline
;
}
}
...
@@ -93,17 +95,25 @@
...
@@ -93,17 +95,25 @@
display
:
flex
;
display
:
flex
;
align-self
:
center
;
align-self
:
center
;
font-size
:
15px
;
font-size
:
15px
;
margin-bottom
:
4px
;
svg
{
svg
{
height
:
15px
;
height
:
15px
;
display
:
block
;
display
:
block
;
fill
:
$
white-light
;
fill
:
$
gl-text-color
;
}
}
a
,
.controllers-buttons
,
.btn-scroll
{
.btn-scroll
{
margin
:
0
8px
;
color
:
$gl-text-color
;
color
:
$white-light
;
height
:
15px
;
vertical-align
:
middle
;
padding
:
0
;
width
:
12px
;
}
.controllers-buttons
{
margin
:
1px
10px
;
}
}
.btn-scroll.animate
{
.btn-scroll.animate
{
...
@@ -137,9 +147,9 @@
...
@@ -137,9 +147,9 @@
top
:
35px
;
top
:
35px
;
left
:
10px
;
left
:
10px
;
bottom
:
0
;
bottom
:
0
;
overflow-y
:
hidden
;
overflow-y
:
scroll
;
padding-bottom
:
20px
;
overflow-x
:
hidden
;
padding
-right
:
20
px
;
padding
:
10px
20px
20px
5
px
;
}
}
.environment-information
{
.environment-information
{
...
...
app/views/projects/jobs/show.html.haml
View file @
481040e2
...
@@ -66,28 +66,23 @@
...
@@ -66,28 +66,23 @@
.controllers
.controllers
-
if
@build
.
has_trace?
-
if
@build
.
has_trace?
=
link_to
raw_namespace_project_job_path
(
@project
.
namespace
,
@project
,
@build
),
=
link_to
raw_namespace_project_job_path
(
@project
.
namespace
,
@project
,
@build
),
title:
'
Open raw trace
'
,
title:
'
Show complete raw
'
,
data:
{
placement:
'top'
,
container:
'body'
},
data:
{
placement:
'top'
,
container:
'body'
},
class:
'js-raw-link-controller has-tooltip'
do
class:
'js-raw-link-controller has-tooltip
controllers-buttons
'
do
=
icon
(
'
download
'
)
=
icon
(
'
file-text-o
'
)
-
if
can?
(
current_user
,
:update_build
,
@project
)
&&
@build
.
erasable?
-
if
can?
(
current_user
,
:update_build
,
@project
)
&&
@build
.
erasable?
=
link_to
erase_namespace_project_job_path
(
@project
.
namespace
,
@project
,
@build
),
=
link_to
erase_namespace_project_job_path
(
@project
.
namespace
,
@project
,
@build
),
method: :post
,
method: :post
,
data:
{
confirm:
'Are you sure you want to erase this build?'
,
placement:
'top'
,
container:
'body'
},
data:
{
confirm:
'Are you sure you want to erase this build?'
,
placement:
'top'
,
container:
'body'
},
title:
'Erase
Build
'
,
title:
'Erase
job log
'
,
class:
'has-tooltip js-erase-link'
do
class:
'has-tooltip js-erase-link
controllers-buttons
'
do
=
icon
(
'trash'
)
=
icon
(
'trash'
)
.has-tooltip.controllers-buttons
{
title:
'Scroll to top'
,
data:
{
placement:
'top'
,
container:
'body'
}
}
%button
.js-scroll-up.btn-scroll.btn-transparent.btn-blank.has-tooltip
{
type:
'button'
,
%button
.js-scroll-up.btn-scroll.btn-transparent.btn-blank
{
type:
'button'
,
disabled:
true
}
disabled:
true
,
title:
'Scroll Up'
,
data:
{
placement:
'top'
,
container:
'body'
}
}
=
custom_icon
(
'scroll_up'
)
=
custom_icon
(
'scroll_up'
)
%button
.js-scroll-down.btn-scroll.btn-transparent.btn-blank.has-tooltip
{
type:
'button'
,
.has-tooltip.controllers-buttons
{
title:
'Scroll to bottom'
,
data:
{
placement:
'top'
,
container:
'body'
}
}
disabled:
true
,
%button
.js-scroll-down.btn-scroll.btn-transparent.btn-blank
{
type:
'button'
,
disabled:
true
}
title:
'Scroll Down'
,
data:
{
placement:
'top'
,
container:
'body'
}
}
=
custom_icon
(
'scroll_down'
)
=
custom_icon
(
'scroll_down'
)
.bash.sticky.js-scroll-container
.bash.sticky.js-scroll-container
%code
.js-build-output
%code
.js-build-output
...
...
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