Skip to content

Commit 7651b6e

Browse files
authored
Merge pull request #322 from SiriusXT/master
fix: Make the fullscreen button exit fullscreen when fullscreen
2 parents c6ff0c4 + a4a08f7 commit 7651b6e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/plugin/toolBar.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ function createToolBarRBContainer(mind: MindElixirInstance) {
2525
// toolBarRBContainer.appendChild(percentage)
2626
toolBarRBContainer.className = 'mind-elixir-toolbar rb'
2727
fc.onclick = () => {
28-
mind.el.requestFullscreen()
28+
if (document.fullscreenElement === mind.el) {
29+
document.exitFullscreen()
30+
} else {
31+
mind.el.requestFullscreen()
32+
}
2933
}
3034
gc.onclick = () => {
3135
mind.toCenter()

0 commit comments

Comments
 (0)