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 {
methods: {
...mapActions('pipelines', ['fetchJobTrace', 'setDetailJob']),
scrollDown() {
if (this.$refs.buildTrace)
if (this.$refs.buildTrace) {
this.$refs.buildTrace.scrollTo(0, this.$refs.buildTrace.scrollHeight);
}
},
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() {
const { scrollTop } = this.$refs.buildTrace;
......
......@@ -3,6 +3,11 @@ import { __ } from '../../../../locale';
import Icon from '../../../../vue_shared/components/icon.vue';
import tooltip from '../../../../vue_shared/directives/tooltip';
const directions = {
up: 'up',
down: 'down',
};
export default {
directives: {
tooltip,
......@@ -15,7 +20,7 @@ export default {
type: String,
required: true,
validator(value) {
return ['up', 'down'].includes(value);
return Object.keys(directions).includes(value);
},
},
disabled: {
......@@ -25,7 +30,7 @@ export default {
},
computed: {
tooltipTitle() {
return this.direction === 'up' ? __('Scroll to top') : __('Scroll to bottom');
return this.direction === directions.up ? __('Scroll to top') : __('Scroll to bottom');
},
iconName() {
return `scroll_${this.direction}`;
......
......@@ -32,6 +32,7 @@ export default {
/>
<div class="ml-auto align-self-center">
<button
type="button"
class="btn btn-default btn-sm"
@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