Skip to content

Commit 37d17c1

Browse files
committed
Bring back menubar without formatting on plain text mode
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent 4403f08 commit 37d17c1

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

src/components/Editor.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@
3636
<MainContainer v-if="$editor">
3737
<!-- Readonly -->
3838
<div v-if="readOnly" class="text-editor--readonly-bar">
39-
<ReadonlyBar />
39+
<ReadonlyBar>
40+
<Status :document="document"
41+
:dirty="dirty"
42+
:sessions="filteredSessions"
43+
:sync-error="syncError"
44+
:has-connection-issue="hasConnectionIssue"
45+
:last-saved-string="lastSavedString" />
46+
</ReadonlyBar>
4047
</div>
4148
<!-- Rich Menu -->
4249
<template v-else>
@@ -262,12 +269,16 @@ export default {
262269
displayed() {
263270
return this.currentSession && this.active
264271
},
265-
renderMenus() {
272+
renderRichEditorMenus() {
266273
return this.contentLoaded
267274
&& this.isRichEditor
268275
&& !this.syncError
269276
&& !this.readOnly
270277
},
278+
renderMenus() {
279+
return this.contentLoaded
280+
&& !this.syncError
281+
},
271282
imagePath() {
272283
return this.relativePath.split('/').slice(0, -1).join('/')
273284
},

src/components/Menu/MenuBar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export default {
186186
clearInterval(this.$checkInterval)
187187
}
188188
189-
if (isWidthAvailable) {
189+
if (isWidthAvailable || !this.$isRichEditor) {
190190
this.$nextTick(() => {
191191
this.isReady = true
192192
})

src/components/Menu/ReadonlyBar.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
v-bind="{ actionEntry }"
99
:key="`text-action--${actionEntry.key}`" />
1010
</div>
11+
<div class="text-menubar__slot">
12+
<slot />
13+
</div>
1114
</div>
1215
</template>
1316

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

3033
<style scoped>
34+
.text-readonly-bar {
35+
display: flex;
36+
}
3137
.text-readonly-bar__entries {
3238
display: flex;
3339
flex-grow: 1;

0 commit comments

Comments
 (0)