2020-04-08 14:13:33 +05:30
|
|
|
<script>
|
2020-04-22 19:07:51 +05:30
|
|
|
import { GlDeprecatedButton, GlTooltipDirective } from '@gitlab/ui';
|
2020-04-08 14:13:33 +05:30
|
|
|
import Icon from '~/vue_shared/components/icon.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Icon,
|
2020-04-22 19:07:51 +05:30
|
|
|
GlDeprecatedButton,
|
2020-04-08 14:13:33 +05:30
|
|
|
},
|
|
|
|
directives: {
|
|
|
|
GlTooltip: GlTooltipDirective,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
scrollUpButtonDisabled: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
scrollDownButtonDisabled: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
scrollUpAvailable: Boolean(this.$listeners.scrollUp),
|
|
|
|
scrollDownAvailable: Boolean(this.$listeners.scrollDown),
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
handleRefreshClick() {
|
|
|
|
this.$emit('refresh');
|
|
|
|
},
|
|
|
|
handleScrollUp() {
|
|
|
|
this.$emit('scrollUp');
|
|
|
|
},
|
|
|
|
handleScrollDown() {
|
|
|
|
this.$emit('scrollDown');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div
|
|
|
|
v-if="scrollUpAvailable"
|
|
|
|
v-gl-tooltip
|
|
|
|
class="controllers-buttons"
|
|
|
|
:title="__('Scroll to top')"
|
|
|
|
aria-labelledby="scroll-to-top"
|
|
|
|
>
|
2020-04-22 19:07:51 +05:30
|
|
|
<gl-deprecated-button
|
2020-04-08 14:13:33 +05:30
|
|
|
id="scroll-to-top"
|
|
|
|
class="btn-blank js-scroll-to-top"
|
|
|
|
:aria-label="__('Scroll to top')"
|
|
|
|
:disabled="scrollUpButtonDisabled"
|
|
|
|
@click="handleScrollUp()"
|
|
|
|
><icon name="scroll_up"
|
2020-04-22 19:07:51 +05:30
|
|
|
/></gl-deprecated-button>
|
2020-04-08 14:13:33 +05:30
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
v-if="scrollDownAvailable"
|
|
|
|
v-gl-tooltip
|
|
|
|
:disabled="scrollUpButtonDisabled"
|
|
|
|
class="controllers-buttons"
|
|
|
|
:title="__('Scroll to bottom')"
|
|
|
|
aria-labelledby="scroll-to-bottom"
|
|
|
|
>
|
2020-04-22 19:07:51 +05:30
|
|
|
<gl-deprecated-button
|
2020-04-08 14:13:33 +05:30
|
|
|
id="scroll-to-bottom"
|
|
|
|
class="btn-blank js-scroll-to-bottom"
|
|
|
|
:aria-label="__('Scroll to bottom')"
|
|
|
|
:v-if="scrollDownAvailable"
|
|
|
|
:disabled="scrollDownButtonDisabled"
|
|
|
|
@click="handleScrollDown()"
|
|
|
|
><icon name="scroll_down"
|
2020-04-22 19:07:51 +05:30
|
|
|
/></gl-deprecated-button>
|
2020-04-08 14:13:33 +05:30
|
|
|
</div>
|
2020-04-22 19:07:51 +05:30
|
|
|
<gl-deprecated-button
|
2020-04-08 14:13:33 +05:30
|
|
|
id="refresh-log"
|
|
|
|
v-gl-tooltip
|
|
|
|
class="ml-1 px-2 js-refresh-log"
|
|
|
|
:title="__('Refresh')"
|
|
|
|
:aria-label="__('Refresh')"
|
|
|
|
@click="handleRefreshClick"
|
|
|
|
>
|
|
|
|
<icon name="retry" />
|
2020-04-22 19:07:51 +05:30
|
|
|
</gl-deprecated-button>
|
2020-04-08 14:13:33 +05:30
|
|
|
</div>
|
|
|
|
</template>
|