Fix import for CommonJS consumers

CommonJS now imports the Terminal object directly as the trick in xterm.ts
wasn't working properly.

Fixes #865
This commit is contained in:
Daniel Imms
2017-08-08 00:24:41 -07:00
parent a0ce9a79a9
commit 3b787824d3
9 changed files with 44 additions and 32 deletions
+4 -4
View File
@@ -8,7 +8,7 @@
/*
* CommonJS environment
*/
module.exports = fullscreen(require('../../xterm'));
module.exports = fullscreen(require('../../Terminal').Terminal);
} else if (typeof define == 'function') {
/*
* Require.js is available
@@ -20,12 +20,12 @@
*/
fullscreen(window.Terminal);
}
})(function (Xterm) {
})(function (Terminal) {
var exports = {};
/**
* Toggle the given terminal's fullscreen mode.
* @param {Xterm} term - The terminal to toggle full screen mode
* @param {Terminal} term - The terminal to toggle full screen mode
* @param {boolean} fullscreen - Toggle fullscreen on (true) or off (false)
*/
exports.toggleFullScreen = function (term, fullscreen) {
@@ -42,7 +42,7 @@
term.element.classList[fn]('fullscreen');
};
Xterm.prototype.toggleFullscreen = function (fullscreen) {
Terminal.prototype.toggleFullscreen = function (fullscreen) {
exports.toggleFullScreen(this, fullscreen);
};