I'm trying to make my ace editor go full screen mode, just like youtube has the possibility to make it's videos full screen.
Does anyone have an idea of how to do this?
I'm trying to make my ace editor go full screen mode, just like youtube has the possibility to make it's videos full screen.
Does anyone have an idea of how to do this?
Share Improve this question edited Jul 26, 2014 at 7:20 Johnny Willemsen 3,0021 gold badge16 silver badges17 bronze badges asked Jul 17, 2014 at 20:02 DoronDoron 1712 gold badges5 silver badges13 bronze badges3 Answers
Reset to default 2You need to resize editor.container
to cover the whole page and call editor.resize()
.
something like this
To enter real fullscreen mode like youtube use editor.container.webkitRequestFullscreen()
see https://developer.mozilla/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode
Unfortunately in fullscreen mode browser captures esc key, so this won't be usable with multiple selections.
2024+ update. You can use the code below to fire up fullscreen mode on F12
key press.
Just adjust the editors[editor_instance]
so it points to your Ace editor object.
editors[editor_instance].mands.addCommand({
name: "save",
bindKey: { win: "F12" },
exec: function(editor) {
editor.container.requestFullscreen();
}
});