Skip to content

Commit

Permalink
Merge pull request #3437 from nextcloud/backport/2757/stable25
Browse files Browse the repository at this point in the history
[stable25] Bring back menubar without formatting on plain text mode
  • Loading branch information
mejo- committed Nov 16, 2022
2 parents 6d99fc9 + 66a67e0 commit 606a652
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 31 deletions.
4 changes: 2 additions & 2 deletions js/editor-collab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor-collab.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/editor-rich.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor-rich.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/files-modal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/files-modal.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions src/components/Editor.vue
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 @@ -266,12 +273,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
4 changes: 0 additions & 4 deletions src/components/Editor/SessionList.vue
Expand Up @@ -144,10 +144,6 @@ export default {
display: inline-flex;
flex-direction: row-reverse;
&:focus {
background-color: #eee;
}
.avatar-wrapper {
margin: 0 -18px 0 0;
z-index: 1;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Menu/MenuBar.vue
Expand Up @@ -184,7 +184,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
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 606a652

Please sign in to comment.