debian-mirror-gitlab/app/assets/javascripts/boards/components/toggle_focus.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.1 KiB
Vue
Raw Normal View History

2021-03-11 19:13:27 +05:30
<script>
import { GlButton, GlTooltipDirective as GlTooltip } from '@gitlab/ui';
import { __ } from '~/locale';
import { hide } from '~/tooltips';
export default {
components: {
GlButton,
},
directives: {
GlTooltip,
},
data() {
return {
isFullscreen: false,
};
},
methods: {
toggleFocusMode() {
hide(this.$refs.toggleFocusModeButton);
2022-06-21 17:19:12 +05:30
const issueBoardsContent = document.querySelector('.content-wrapper > .js-focus-mode-board');
2022-08-13 15:12:31 +05:30
issueBoardsContent?.classList.toggle('is-focused');
2021-03-11 19:13:27 +05:30
this.isFullscreen = !this.isFullscreen;
},
},
i18n: {
toggleFocusMode: __('Toggle focus mode'),
},
};
</script>
<template>
2021-04-29 21:17:54 +05:30
<div class="gl-ml-3 gl-display-none gl-md-display-flex gl-align-items-center">
2021-03-11 19:13:27 +05:30
<gl-button
ref="toggleFocusModeButton"
v-gl-tooltip
2021-04-29 21:17:54 +05:30
category="tertiary"
2021-03-11 19:13:27 +05:30
:icon="isFullscreen ? 'minimize' : 'maximize'"
data-qa-selector="focus_mode_button"
:title="$options.i18n.toggleFocusMode"
2021-04-29 21:17:54 +05:30
:aria-label="$options.i18n.toggleFocusMode"
2021-03-11 19:13:27 +05:30
@click="toggleFocusMode"
/>
</div>
</template>