Skip to content

Commit

Permalink
refactor(editor): cleanup autohide mechanism
Browse files Browse the repository at this point in the history
Signed-off-by: Max <[email protected]>
  • Loading branch information
max-nextcloud committed Jan 2, 2024
1 parent 2f2be40 commit c7df9de
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/components/Menu/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
:aria-label="t('text', 'Editor actions')"
:class="{
'text-menubar--ready': isReady,
'text-menubar--show': isVisible,
'text-menubar--hide': isHidden,
'text-menubar--is-workspace': $isRichWorkspace
}">
Expand Down Expand Up @@ -84,7 +83,6 @@
<script>
import { NcActionSeparator, NcActionButton } from '@nextcloud/vue'
import { loadState } from '@nextcloud/initial-state'
import debounce from 'debounce'
import { useResizeObserver } from '@vueuse/core'
import ActionFormattingHelp from './ActionFormattingHelp.vue'
Expand Down Expand Up @@ -148,7 +146,6 @@ export default {
displayHelp: false,
displayTranslate: false,
isReady: false,
isVisible: this.$editor.isFocused,
canTranslate: loadState('text', 'translation_languages', []).length > 0,
resize: null,
iconsLimit: 4,
Expand Down Expand Up @@ -178,13 +175,6 @@ export default {
mounted() {
this.resize = useResizeObserver(this.$refs.menubar, this.onResize)
this.$onFocusChange = () => {
this.isVisible = this.$editor.isFocused
}
this.$onBlurChange = debounce(() => {
this.isVisible = this.$editor.isFocused
}, 3000) // 3s
this.$editor.on('focus', this.$onFocusChange)
this.$editor.on('blur', this.$onBlurChange)
Expand Down Expand Up @@ -283,10 +273,6 @@ export default {
&.text-menubar--hide {
opacity: 0;
transition: visibility 0.2s 0.4s, opacity 0.2s 0.4s;
&.text-menubar--show {
visibility: visible;
opacity: 1;
}
}
.text-menubar__entries {
display: flex;
Expand Down

0 comments on commit c7df9de

Please sign in to comment.