Commit d2dcfe5f authored by Phil Hughes's avatar Phil Hughes

added missing button type

moved values to constants
parent deaf4f72
...@@ -40,11 +40,14 @@ export default { ...@@ -40,11 +40,14 @@ export default {
methods: { methods: {
...mapActions('pipelines', ['fetchJobTrace', 'setDetailJob']), ...mapActions('pipelines', ['fetchJobTrace', 'setDetailJob']),
scrollDown() { scrollDown() {
if (this.$refs.buildTrace) if (this.$refs.buildTrace) {
this.$refs.buildTrace.scrollTo(0, this.$refs.buildTrace.scrollHeight); this.$refs.buildTrace.scrollTo(0, this.$refs.buildTrace.scrollHeight);
}
}, },
scrollUp() { scrollUp() {
if (this.$refs.buildTrace) this.$refs.buildTrace.scrollTo(0, 0); if (this.$refs.buildTrace) {
this.$refs.buildTrace.scrollTo(0, 0);
}
}, },
scrollBuildLog: _.throttle(function buildLogScrollDebounce() { scrollBuildLog: _.throttle(function buildLogScrollDebounce() {
const { scrollTop } = this.$refs.buildTrace; const { scrollTop } = this.$refs.buildTrace;
......
...@@ -3,6 +3,11 @@ import { __ } from '../../../../locale'; ...@@ -3,6 +3,11 @@ import { __ } from '../../../../locale';
import Icon from '../../../../vue_shared/components/icon.vue'; import Icon from '../../../../vue_shared/components/icon.vue';
import tooltip from '../../../../vue_shared/directives/tooltip'; import tooltip from '../../../../vue_shared/directives/tooltip';
const directions = {
up: 'up',
down: 'down',
};
export default { export default {
directives: { directives: {
tooltip, tooltip,
...@@ -15,7 +20,7 @@ export default { ...@@ -15,7 +20,7 @@ export default {
type: String, type: String,
required: true, required: true,
validator(value) { validator(value) {
return ['up', 'down'].includes(value); return Object.keys(directions).includes(value);
}, },
}, },
disabled: { disabled: {
...@@ -25,7 +30,7 @@ export default { ...@@ -25,7 +30,7 @@ export default {
}, },
computed: { computed: {
tooltipTitle() { tooltipTitle() {
return this.direction === 'up' ? __('Scroll to top') : __('Scroll to bottom'); return this.direction === directions.up ? __('Scroll to top') : __('Scroll to bottom');
}, },
iconName() { iconName() {
return `scroll_${this.direction}`; return `scroll_${this.direction}`;
......
...@@ -32,6 +32,7 @@ export default { ...@@ -32,6 +32,7 @@ export default {
/> />
<div class="ml-auto align-self-center"> <div class="ml-auto align-self-center">
<button <button
type="button"
class="btn btn-default btn-sm" class="btn btn-default btn-sm"
@click="clickViewLog" @click="clickViewLog"
> >
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment