|
34 | 34 | :content-loaded="contentLoaded" |
35 | 35 | :show-author-annotations="showAuthorAnnotations"> |
36 | 36 | <MainContainer v-if="$editor"> |
37 | | - <MenuBar v-if="renderMenus" |
38 | | - ref="menubar" |
39 | | - :autohide="autohide" |
40 | | - :loaded.sync="menubarLoaded"> |
41 | | - <Status :document="document" |
42 | | - :dirty="dirty" |
43 | | - :sessions="filteredSessions" |
44 | | - :sync-error="syncError" |
45 | | - :has-connection-issue="hasConnectionIssue" |
46 | | - :last-saved-string="lastSavedString" /> |
47 | | - <slot name="header" /> |
48 | | - </MenuBar> |
49 | | - <div v-if="!menubarLoaded" class="menubar-placeholder" /> |
| 37 | + <!-- Readonly --> |
| 38 | + <div v-if="readOnly" class="text-editor--readonly-bar"> |
| 39 | + <ReadonlyBar /> |
| 40 | + </div> |
| 41 | + <!-- Rich Menu --> |
| 42 | + <template v-else> |
| 43 | + <MenuBar v-if="renderMenus" |
| 44 | + ref="menubar" |
| 45 | + :autohide="autohide" |
| 46 | + :loaded.sync="menubarLoaded"> |
| 47 | + <Status :document="document" |
| 48 | + :dirty="dirty" |
| 49 | + :sessions="filteredSessions" |
| 50 | + :sync-error="syncError" |
| 51 | + :has-connection-issue="hasConnectionIssue" |
| 52 | + :last-saved-string="lastSavedString" /> |
| 53 | + <slot name="header" /> |
| 54 | + </MenuBar> |
| 55 | + <div v-else class="menubar-placeholder" /> |
| 56 | + </template> |
50 | 57 | <ContentContainer v-show="contentLoaded" |
51 | 58 | ref="contentWrapper"> |
52 | 59 | <MenuBubble v-if="renderMenus" |
@@ -84,6 +91,7 @@ import { |
84 | 91 | IS_RICH_WORKSPACE, |
85 | 92 | SYNC_SERVICE, |
86 | 93 | } from './Editor.provider.js' |
| 94 | +import ReadonlyBar from './Menu/ReadonlyBar.vue' |
87 | 95 |
|
88 | 96 | import { logger } from '../helpers/logger.js' |
89 | 97 | import { SyncService, ERROR_TYPE, IDLE_TIMEOUT } from './../services/SyncService.js' |
@@ -112,6 +120,7 @@ export default { |
112 | 120 | DocumentStatus, |
113 | 121 | Wrapper, |
114 | 122 | MainContainer, |
| 123 | + ReadonlyBar, |
115 | 124 | ContentContainer, |
116 | 125 | MenuBar, |
117 | 126 | MenuBubble: () => import(/* webpackChunkName: "editor-rich" */'./MenuBubble.vue'), |
@@ -686,61 +695,74 @@ export default { |
686 | 695 | </script> |
687 | 696 |
|
688 | 697 | <style scoped lang="scss"> |
689 | | - .modal-container .text-editor { |
690 | | - top: 0; |
691 | | - height: calc(100vh - var(--header-height)); |
692 | | - } |
| 698 | +.modal-container .text-editor { |
| 699 | + top: 0; |
| 700 | + height: calc(100vh - var(--header-height)); |
| 701 | +} |
693 | 702 |
|
694 | | - .text-editor { |
695 | | - display: block; |
696 | | - width: 100%; |
697 | | - max-width: 100%; |
698 | | - height: 100%; |
699 | | - left: 0; |
700 | | - margin: 0 auto; |
701 | | - position: relative; |
702 | | - background-color: var(--color-main-background); |
703 | | - } |
| 703 | +.text-editor { |
| 704 | + display: block; |
| 705 | + width: 100%; |
| 706 | + max-width: 100%; |
| 707 | + height: 100%; |
| 708 | + left: 0; |
| 709 | + margin: 0 auto; |
| 710 | + position: relative; |
| 711 | + background-color: var(--color-main-background); |
| 712 | +} |
704 | 713 |
|
705 | | - .text-editor .text-editor__wrapper.has-conflicts { |
706 | | - height: calc(100% - 50px); |
| 714 | +.text-editor .text-editor__wrapper.has-conflicts { |
| 715 | + height: calc(100% - 50px); |
707 | 716 |
|
708 | | - .text-editor__main, #read-only-editor { |
709 | | - width: 50%; |
710 | | - height: 100%; |
711 | | - } |
| 717 | + .text-editor__main, #read-only-editor { |
| 718 | + width: 50%; |
| 719 | + height: 100%; |
712 | 720 | } |
| 721 | +} |
713 | 722 |
|
714 | | - #body-public { |
715 | | - height: auto; |
716 | | - } |
| 723 | +#body-public { |
| 724 | + height: auto; |
| 725 | +} |
717 | 726 |
|
718 | | - #files-public-content { |
719 | | - .text-editor { |
720 | | - top: 0; |
721 | | - width: 100%; |
| 727 | +#files-public-content { |
| 728 | + .text-editor { |
| 729 | + top: 0; |
| 730 | + width: 100%; |
722 | 731 |
|
723 | | - .text-editor__main { |
724 | | - overflow: auto; |
725 | | - z-index: 20; |
726 | | - } |
727 | | - .has-conflicts .text-editor__main { |
728 | | - padding-top: 0; |
729 | | - } |
| 732 | + .text-editor__main { |
| 733 | + overflow: auto; |
| 734 | + z-index: 20; |
| 735 | + } |
| 736 | + .has-conflicts .text-editor__main { |
| 737 | + padding-top: 0; |
730 | 738 | } |
731 | 739 | } |
| 740 | +} |
732 | 741 |
|
733 | | - .menubar-placeholder { |
734 | | - position: fixed; |
735 | | - position: -webkit-sticky; |
736 | | - position: sticky; |
737 | | - top: 0; |
738 | | - opacity: 0; |
739 | | - visibility: hidden; |
740 | | - height: 44px; // important for mobile so that the buttons are always inside the container |
741 | | - padding-top:3px; |
742 | | - padding-bottom: 3px; |
743 | | - } |
| 742 | +.menubar-placeholder, |
| 743 | +.text-editor--readonly-bar { |
| 744 | + position: fixed; |
| 745 | + position: -webkit-sticky; |
| 746 | + position: sticky; |
| 747 | + top: 0; |
| 748 | + opacity: 0; |
| 749 | + visibility: hidden; |
| 750 | + height: 44px; // important for mobile so that the buttons are always inside the container |
| 751 | + padding-top:3px; |
| 752 | + padding-bottom: 3px; |
| 753 | +} |
| 754 | +
|
| 755 | +.text-editor--readonly-bar, |
| 756 | +.menubar-placeholder--with-slot { |
| 757 | + opacity: unset; |
| 758 | + visibility: unset; |
| 759 | +
|
| 760 | + z-index: 50; |
| 761 | + max-width: var(--text-editor-max-width); |
| 762 | + margin: auto; |
| 763 | + width: 100%; |
| 764 | + background-color: var(--color-main-background); |
| 765 | +} |
744 | 766 |
|
745 | 767 | </style> |
746 | 768 |
|
|
0 commit comments