File tree Expand file tree Collapse file tree 3 files changed +28
-8
lines changed
Expand file tree Collapse file tree 3 files changed +28
-8
lines changed Original file line number Diff line number Diff line change 4343 <MainContainer v-if =" hasEditor" >
4444 <!-- Readonly -->
4545 <div v-if =" readOnly" class =" text-editor--readonly-bar" >
46- <ReadonlyBar >
47- <Status :document =" document"
48- :dirty =" dirty"
49- :sessions =" filteredSessions"
50- :sync-error =" syncError"
51- :has-connection-issue =" hasConnectionIssue" />
52- </ReadonlyBar >
46+ <slot name =" readonlyBar" >
47+ <ReadonlyBar >
48+ <Status :document =" document"
49+ :dirty =" dirty"
50+ :sessions =" filteredSessions"
51+ :sync-error =" syncError"
52+ :has-connection-issue =" hasConnectionIssue" />
53+ </ReadonlyBar >
54+ </slot >
5355 </div >
5456 <!-- Rich Menu -->
5557 <template v-else >
Original file line number Diff line number Diff line change 2525 @outline-toggled =" outlineToggled" >
2626 <MainContainer >
2727 <MenuBar v-if =" !readOnly" :autohide =" false" />
28- <ReadonlyBar v-else />
28+ <slot v-else name =" readonlyBar" >
29+ <ReadonlyBar />
30+ </slot >
2931 <ContentContainer />
3032 </MainContainer >
3133 </Wrapper >
Original file line number Diff line number Diff line change @@ -139,6 +139,10 @@ window.OCA.Text.createEditor = async function({
139139
140140 readOnly = false ,
141141 autofocus = true ,
142+ readonlyBar = {
143+ component : null ,
144+ props : null ,
145+ } ,
142146
143147 onLoaded = ( ) => { } ,
144148 onUpdate = ( { markdown } ) => { } ,
@@ -179,6 +183,16 @@ window.OCA.Text.createEditor = async function({
179183 return data
180184 } ,
181185 render : h => {
186+ const scopedSlots = readonlyBar ?. component
187+ ? {
188+ readonlyBar : ( ) => {
189+ return h ( readonlyBar . component , {
190+ props : readonlyBar . props ,
191+ } )
192+ } ,
193+ }
194+ : { }
195+
182196 return fileId
183197 ? h ( Editor , {
184198 props : {
@@ -190,13 +204,15 @@ window.OCA.Text.createEditor = async function({
190204 autofocus,
191205 showOutlineOutside : data . showOutlineOutside ,
192206 } ,
207+ scopedSlots,
193208 } )
194209 : h ( MarkdownContentEditor , {
195210 props : {
196211 content : data . content ,
197212 readOnly : data . readOnly ,
198213 showOutlineOutside : data . showOutlineOutside ,
199214 } ,
215+ scopedSlots,
200216 } )
201217 } ,
202218 store,
You can’t perform that action at this time.
0 commit comments