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-03-28 20:09:36 -04:00
|
|
|
<div class="gl-ml-3 gl-display-none gl-md-display-flex gl-align-items-center">
|
2021-02-11 07:08:52 -05:00
|
|
|
<gl-button
|
2021-01-27 10:09:15 -05:00
|
|
|
ref="toggleFocusModeButton"
|
2021-02-11 07:08:52 -05:00
|
|
|
v-gl-tooltip
|
2021-03-24 02:09:16 -04:00
|
|
|
category="tertiary"
|
2021-02-11 07:08:52 -05:00
|
|
|
: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"
|
2021-03-26 08:09:15 -04:00
|
|
|
:aria-label="$options.i18n.toggleFocusMode"
|
2021-01-27 10:09:15 -05:00
|
|
|
@click="toggleFocusMode"
|
2021-02-11 07:08:52 -05:00
|
|
|
/>
|
2021-01-27 10:09:15 -05:00
|
|
|
</div>
|
|
|
|
</template>
|