Skip to content

Commit

Permalink
Bring back menubar without formatting on plain text mode
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Nov 15, 2022
1 parent 4403f08 commit 37d17c1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
15 changes: 13 additions & 2 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@
<MainContainer v-if="$editor">
<!-- Readonly -->
<div v-if="readOnly" class="text-editor--readonly-bar">
<ReadonlyBar />
<ReadonlyBar>
<Status :document="document"
:dirty="dirty"
:sessions="filteredSessions"
:sync-error="syncError"
:has-connection-issue="hasConnectionIssue"
:last-saved-string="lastSavedString" />
</ReadonlyBar>
</div>
<!-- Rich Menu -->
<template v-else>
Expand Down Expand Up @@ -262,12 +269,16 @@ export default {
displayed() {
return this.currentSession && this.active
},
renderMenus() {
renderRichEditorMenus() {
return this.contentLoaded
&& this.isRichEditor
&& !this.syncError
&& !this.readOnly
},
renderMenus() {
return this.contentLoaded
&& !this.syncError
},
imagePath() {
return this.relativePath.split('/').slice(0, -1).join('/')
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Menu/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default {
clearInterval(this.$checkInterval)
}

if (isWidthAvailable) {
if (isWidthAvailable || !this.$isRichEditor) {
this.$nextTick(() => {
this.isReady = true
})
Expand Down
6 changes: 6 additions & 0 deletions src/components/Menu/ReadonlyBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
v-bind="{ actionEntry }"
:key="`text-action--${actionEntry.key}`" />
</div>
<div class="text-menubar__slot">
<slot />
</div>
</div>
</template>

Expand All @@ -28,6 +31,9 @@ export default defineComponent({
</script>

<style scoped>
.text-readonly-bar {
display: flex;
}
.text-readonly-bar__entries {
display: flex;
flex-grow: 1;
Expand Down

0 comments on commit 37d17c1

Please sign in to comment.