|
48 | 48 | :dirty="dirty"
|
49 | 49 | :sessions="filteredSessions"
|
50 | 50 | :sync-error="syncError"
|
51 |
| - :has-connection-issue="hasConnectionIssue" /> |
| 51 | + :has-connection-issue="hasConnectionIssue" |
| 52 | + @editor-width-change="handleEditorWidthChange" /> |
52 | 53 | <slot name="header" />
|
53 | 54 | </MenuBar>
|
54 | 55 | <div v-else class="menubar-placeholder" />
|
@@ -321,13 +322,22 @@ export default {
|
321 | 322 | },
|
322 | 323 | }
|
323 | 324 | },
|
| 325 | + editorMaxWidth() { |
| 326 | + return loadState('text', 'is_full_width_editor', false) ? '100%' : '80ch' |
| 327 | + }, |
324 | 328 | },
|
325 | 329 | watch: {
|
326 | 330 | displayed() {
|
327 | 331 | this.$nextTick(() => {
|
328 | 332 | this.contentWrapper = this.$refs.contentWrapper
|
329 | 333 | })
|
330 | 334 | },
|
| 335 | + editorMaxWidth: { |
| 336 | + immediate: true, |
| 337 | + handler(newWidth) { |
| 338 | + this.updateEditorWidth(newWidth) |
| 339 | + }, |
| 340 | + }, |
331 | 341 | },
|
332 | 342 | mounted() {
|
333 | 343 | if (this.active && (this.hasDocumentParameters)) {
|
@@ -860,6 +870,19 @@ export default {
|
860 | 870 | })
|
861 | 871 | this.translateModal = false
|
862 | 872 | },
|
| 873 | + |
| 874 | + handleEditorWidthChange(newWidth) { |
| 875 | + this.updateEditorWidth(newWidth) |
| 876 | + this.$nextTick(() => { |
| 877 | + if (this.$editor) { |
| 878 | + this.$editor.view.updateState(this.$editor.view.state) |
| 879 | + this.$editor.commands.focus() |
| 880 | + } |
| 881 | + }) |
| 882 | + }, |
| 883 | + updateEditorWidth(newWidth) { |
| 884 | + document.documentElement.style.setProperty('--text-editor-max-width', newWidth) |
| 885 | + }, |
863 | 886 | },
|
864 | 887 | }
|
865 | 888 | </script>
|
@@ -931,75 +954,75 @@ export default {
|
931 | 954 | </style>
|
932 | 955 |
|
933 | 956 | <style lang="scss">
|
934 |
| - @import './../css/variables'; |
935 |
| - @import './../css/style'; |
936 |
| - @import './../css/print'; |
| 957 | +@import './../css/variables'; |
| 958 | +@import './../css/style'; |
| 959 | +@import './../css/print'; |
937 | 960 |
|
938 |
| - .text-editor__wrapper { |
939 |
| - @import './../css/prosemirror'; |
| 961 | +.text-editor__wrapper { |
| 962 | + @import './../css/prosemirror'; |
940 | 963 |
|
941 |
| - // relative position for the alignment of the menububble |
942 |
| - .text-editor__main { |
943 |
| - &.draggedOver { |
944 |
| - background-color: var(--color-primary-element-light); |
945 |
| - } |
946 |
| - .text-editor__content-wrapper { |
947 |
| - position: relative; |
948 |
| - } |
| 964 | + // relative position for the alignment of the menububble |
| 965 | + .text-editor__main { |
| 966 | + &.draggedOver { |
| 967 | + background-color: var(--color-primary-element-light); |
| 968 | + } |
| 969 | + .text-editor__content-wrapper { |
| 970 | + position: relative; |
949 | 971 | }
|
950 | 972 | }
|
| 973 | +} |
951 | 974 |
|
952 |
| - .text-editor__wrapper.has-conflicts > .editor { |
953 |
| - width: 50%; |
954 |
| - } |
| 975 | +.text-editor__wrapper.has-conflicts > .editor { |
| 976 | + width: 50%; |
| 977 | +} |
955 | 978 |
|
956 |
| - .text-editor__wrapper.has-conflicts > .content-wrapper { |
957 |
| - width: 50%; |
958 |
| - #read-only-editor { |
959 |
| - margin: 0px auto; |
960 |
| - padding-top: 50px; |
961 |
| - overflow: initial; |
962 |
| - } |
| 979 | +.text-editor__wrapper.has-conflicts > .content-wrapper { |
| 980 | + width: 50%; |
| 981 | + #read-only-editor { |
| 982 | + margin: 0px auto; |
| 983 | + padding-top: 50px; |
| 984 | + overflow: initial; |
963 | 985 | }
|
| 986 | +} |
964 | 987 |
|
965 |
| - @keyframes spin { |
966 |
| - 0% { transform: rotate(0deg); } |
967 |
| - 100% { transform: rotate(360deg); } |
968 |
| - } |
| 988 | +@keyframes spin { |
| 989 | + 0% { transform: rotate(0deg); } |
| 990 | + 100% { transform: rotate(360deg); } |
| 991 | +} |
969 | 992 |
|
970 |
| - /* Give a remote user a caret */ |
971 |
| - .collaboration-cursor__caret { |
972 |
| - position: relative; |
973 |
| - margin-left: -1px; |
974 |
| - margin-right: -1px; |
975 |
| - border-left: 1px solid #0D0D0D; |
976 |
| - border-right: 1px solid #0D0D0D; |
977 |
| - word-break: normal; |
978 |
| - pointer-events: none; |
979 |
| - } |
| 993 | +/* Give a remote user a caret */ |
| 994 | +.collaboration-cursor__caret { |
| 995 | + position: relative; |
| 996 | + margin-left: -1px; |
| 997 | + margin-right: -1px; |
| 998 | + border-left: 1px solid #0D0D0D; |
| 999 | + border-right: 1px solid #0D0D0D; |
| 1000 | + word-break: normal; |
| 1001 | + pointer-events: none; |
| 1002 | +} |
980 | 1003 |
|
981 |
| - /* Render the username above the caret */ |
982 |
| - .collaboration-cursor__label { |
983 |
| - position: absolute; |
984 |
| - top: -1.4em; |
985 |
| - left: -1px; |
986 |
| - font-size: 12px; |
987 |
| - font-style: normal; |
988 |
| - font-weight: 600; |
989 |
| - line-height: normal; |
990 |
| - user-select: none; |
991 |
| - color: #0D0D0D; |
992 |
| - padding: 0.1rem 0.3rem; |
993 |
| - border-radius: 3px 3px 3px 0; |
994 |
| - white-space: nowrap; |
995 |
| - opacity: 0; |
996 |
| - |
997 |
| - &.collaboration-cursor__label__active { |
998 |
| - opacity: 1; |
999 |
| - } |
| 1004 | +/* Render the username above the caret */ |
| 1005 | +.collaboration-cursor__label { |
| 1006 | + position: absolute; |
| 1007 | + top: -1.4em; |
| 1008 | + left: -1px; |
| 1009 | + font-size: 12px; |
| 1010 | + font-style: normal; |
| 1011 | + font-weight: 600; |
| 1012 | + line-height: normal; |
| 1013 | + user-select: none; |
| 1014 | + color: #0D0D0D; |
| 1015 | + padding: 0.1rem 0.3rem; |
| 1016 | + border-radius: 3px 3px 3px 0; |
| 1017 | + white-space: nowrap; |
| 1018 | + opacity: 0; |
1000 | 1019 |
|
1001 |
| - &:not(.collaboration-cursor__label__active) { |
1002 |
| - transition: opacity 0.2s 5s; |
1003 |
| - } |
| 1020 | + &.collaboration-cursor__label__active { |
| 1021 | + opacity: 1; |
1004 | 1022 | }
|
| 1023 | + |
| 1024 | + &:not(.collaboration-cursor__label__active) { |
| 1025 | + transition: opacity 0.2s 5s; |
| 1026 | + } |
| 1027 | +} |
1005 | 1028 | </style>
|
0 commit comments