2021-01-27 10:09:15 -05:00
|
|
|
<script>
|
2021-02-11 07:08:52 -05:00
|
|
|
import { GlButton, GlTooltipDirective as GlTooltip } from '@gitlab/ui';
|
2021-01-27 10:09:15 -05:00
|
|
|
import { __ } from '~/locale';
|
|
|
|
import { hide } from '~/tooltips';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2021-02-11 07:08:52 -05:00
|
|
|
GlButton,
|
|
|
|
},
|
|
|
|
directives: {
|
|
|
|
GlTooltip,
|
2021-01-27 10:09:15 -05:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
issueBoardsContentSelector: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
isFullscreen: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggleFocusMode() {
|
|
|
|
hide(this.$refs.toggleFocusModeButton);
|
|
|
|
|
|
|
|
const issueBoardsContent = document.querySelector(this.issueBoardsContentSelector);
|
|
|
|
issueBoardsContent.classList.toggle('is-focused');
|
|
|
|
|
|
|
|
this.isFullscreen = !this.isFullscreen;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
i18n: {
|
|
|
|
toggleFocusMode: __('Toggle focus mode'),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2021-02-11 07:08:52 -05:00
|
|
|
<div class="board-extra-actions gl-ml-3 gl-display-flex gl-align-items-center">
|
|
|
|
<gl-button
|
2021-01-27 10:09:15 -05:00
|
|
|
ref="toggleFocusModeButton"
|
2021-02-11 07:08:52 -05:00
|
|
|
v-gl-tooltip
|
|
|
|
:icon="isFullscreen ? 'minimize' : 'maximize'"
|
|
|
|
class="js-focus-mode-btn"
|
2021-01-27 10:09:15 -05:00
|
|
|
data-qa-selector="focus_mode_button"
|
|
|
|
:title="$options.i18n.toggleFocusMode"
|
|
|
|
@click="toggleFocusMode"
|
2021-02-11 07:08:52 -05:00
|
|
|
/>
|
2021-01-27 10:09:15 -05:00
|
|
|
</div>
|
|
|
|
</template>
|