diff options
author | Phil Hughes <me@iamphill.com> | 2018-06-05 17:45:11 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-06-06 10:33:05 +0300 |
commit | d2dcfe5f3bb2eb855c4f9f96df34ce87540892ef (patch) | |
tree | af91f7169f627d5c65b17e2c1723559bf6e5c56a /app/assets | |
parent | deaf4f72aafa5e248fc58c7a01eef840d0401bd1 (diff) |
added missing button type
moved values to constants
Diffstat (limited to 'app/assets')
3 files changed, 13 insertions, 4 deletions
diff --git a/app/assets/javascripts/ide/components/jobs/detail.vue b/app/assets/javascripts/ide/components/jobs/detail.vue index 9169e138c1e..af80fd53a18 100644 --- a/app/assets/javascripts/ide/components/jobs/detail.vue +++ b/app/assets/javascripts/ide/components/jobs/detail.vue @@ -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; diff --git a/app/assets/javascripts/ide/components/jobs/detail/scroll_button.vue b/app/assets/javascripts/ide/components/jobs/detail/scroll_button.vue index 3ecb99c581b..4e19e6e9c84 100644 --- a/app/assets/javascripts/ide/components/jobs/detail/scroll_button.vue +++ b/app/assets/javascripts/ide/components/jobs/detail/scroll_button.vue @@ -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}`; diff --git a/app/assets/javascripts/ide/components/jobs/item.vue b/app/assets/javascripts/ide/components/jobs/item.vue index 8848a334a48..82881e2cc7f 100644 --- a/app/assets/javascripts/ide/components/jobs/item.vue +++ b/app/assets/javascripts/ide/components/jobs/item.vue @@ -32,6 +32,7 @@ export default { /> <div class="ml-auto align-self-center"> <button + type="button" class="btn btn-default btn-sm" @click="clickViewLog" > |