Skip to content

Commit faee7ab

Browse files
Command palette while presentation mode. Toggle presentation start node
1 parent 4d518d4 commit faee7ab

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/canvas-extensions/presentation-canvas-extension.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export default class PresentationCanvasExtension {
113113
const startNode = this.getStartNode(canvas)
114114
if (startNode) canvas.setNodeData(startNode, 'isStartNode', false)
115115

116-
canvas.setNodeData(node, 'isStartNode', true)
116+
if (node !== startNode) canvas.setNodeData(node, 'isStartNode', true)
117117
}
118118

119119
private getSlideSize(): Size {
@@ -193,9 +193,25 @@ export default class PresentationCanvasExtension {
193193
}
194194
}
195195

196+
// Keep modals while in fullscreen mode
197+
const fullscreenModalObserver = new MutationObserver((mutationRecords) => {
198+
mutationRecords.forEach((mutationRecord) => {
199+
mutationRecord.addedNodes.forEach((node) => {
200+
document.body.removeChild(node)
201+
document.fullscreenElement?.appendChild(node)
202+
})
203+
})
204+
205+
const inputField = document.querySelector(".prompt-input") as HTMLInputElement|null
206+
if (inputField) inputField.focus()
207+
})
208+
fullscreenModalObserver.observe(document.body, { childList: true })
209+
196210
// Register event handler for exiting presentation mode
197211
canvas.wrapperEl.onfullscreenchange = (_e: any) => {
198212
if (document.fullscreenElement) return
213+
214+
fullscreenModalObserver.disconnect()
199215
this.endPresentation(canvas)
200216
}
201217

0 commit comments

Comments
 (0)