mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-10-05 01:48:08 +00:00
25 lines
684 B
JavaScript
25 lines
684 B
JavaScript
/*
|
|
* Fullscreen addon for xterm.js
|
|
*
|
|
* Implements the toggleFullscreen function.
|
|
*
|
|
* If the `fullscreen` argument has been supplied, then
|
|
* if it is true, the fullscreen mode gets turned on,
|
|
* if it is false or null, the fullscreen mode gets turned off.
|
|
*
|
|
* If the `fullscreen` argument has not been supplied, the
|
|
* fullscreen mode is being toggled.
|
|
*/
|
|
Terminal.prototype.toggleFullscreen = function (fullscreen) {
|
|
var fn;
|
|
|
|
if (typeof fullscreen == 'undefined') {
|
|
fn = (this.element.classList.contains('fullscreen')) ? 'remove' : 'add';
|
|
} else if (!fullscreen) {
|
|
fn = 'remove';
|
|
} else {
|
|
fn = 'add';
|
|
}
|
|
|
|
this.element.classList[fn]('fullscreen');
|
|
} |