Comparing version 2.3.1 to 2.3.2
{ | ||
"name": "xterm.js", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"ignore": ["demo", "test", ".gitignore"], | ||
@@ -5,0 +5,0 @@ "main": [ |
@@ -10,3 +10,2 @@ const browserify = require('browserify'); | ||
const ts = require('gulp-typescript'); | ||
const tsify = require('tsify'); | ||
@@ -57,3 +56,2 @@ | ||
let bundleStream = browserify(browserifyOptions) | ||
.plugin(tsify) | ||
.bundle() | ||
@@ -60,0 +58,0 @@ .pipe(source('xterm.js')) |
"use strict"; | ||
var Viewport = (function () { | ||
function Viewport(terminal, viewportElement, scrollArea, charMeasure) { | ||
var _this = this; | ||
this.terminal = terminal; | ||
@@ -14,3 +15,3 @@ this.viewportElement = viewportElement; | ||
this.viewportElement.addEventListener('scroll', this.onScroll.bind(this)); | ||
this.syncScrollArea(); | ||
setTimeout(function () { return _this.syncScrollArea(); }, 0); | ||
} | ||
@@ -17,0 +18,0 @@ Viewport.prototype.refresh = function () { |
@@ -41,9 +41,12 @@ "use strict"; | ||
describe('refresh', function () { | ||
it('should set the line-height of the terminal', function () { | ||
chai_1.assert.equal(viewportElement.style.lineHeight, CHARACTER_HEIGHT + 'px'); | ||
chai_1.assert.equal(terminal.rowContainer.style.lineHeight, CHARACTER_HEIGHT + 'px'); | ||
charMeasure.height = 1; | ||
viewport.refresh(); | ||
chai_1.assert.equal(viewportElement.style.lineHeight, '1px'); | ||
chai_1.assert.equal(terminal.rowContainer.style.lineHeight, '1px'); | ||
it('should set the line-height of the terminal', function (done) { | ||
setTimeout(function () { | ||
chai_1.assert.equal(viewportElement.style.lineHeight, CHARACTER_HEIGHT + 'px'); | ||
chai_1.assert.equal(terminal.rowContainer.style.lineHeight, CHARACTER_HEIGHT + 'px'); | ||
charMeasure.height = 1; | ||
viewport.refresh(); | ||
chai_1.assert.equal(viewportElement.style.lineHeight, '1px'); | ||
chai_1.assert.equal(terminal.rowContainer.style.lineHeight, '1px'); | ||
done(); | ||
}, 0); | ||
}); | ||
@@ -62,13 +65,16 @@ it('should set the height of the viewport when the line-height changed', function () { | ||
describe('syncScrollArea', function () { | ||
it('should sync the scroll area', function () { | ||
terminal.lines.push(''); | ||
terminal.rows = 1; | ||
chai_1.assert.equal(scrollAreaElement.style.height, 0 * CHARACTER_HEIGHT + 'px'); | ||
viewport.syncScrollArea(); | ||
chai_1.assert.equal(viewportElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
chai_1.assert.equal(scrollAreaElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
terminal.lines.push(''); | ||
viewport.syncScrollArea(); | ||
chai_1.assert.equal(viewportElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
chai_1.assert.equal(scrollAreaElement.style.height, 2 * CHARACTER_HEIGHT + 'px'); | ||
it('should sync the scroll area', function (done) { | ||
setTimeout(function () { | ||
terminal.lines.push(''); | ||
terminal.rows = 1; | ||
chai_1.assert.equal(scrollAreaElement.style.height, 0 * CHARACTER_HEIGHT + 'px'); | ||
viewport.syncScrollArea(); | ||
chai_1.assert.equal(viewportElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
chai_1.assert.equal(scrollAreaElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
terminal.lines.push(''); | ||
viewport.syncScrollArea(); | ||
chai_1.assert.equal(viewportElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
chai_1.assert.equal(scrollAreaElement.style.height, 2 * CHARACTER_HEIGHT + 'px'); | ||
done(); | ||
}, 0); | ||
}); | ||
@@ -75,0 +81,0 @@ }); |
{ | ||
"name": "xterm", | ||
"description": "Full xterm terminal, in your browser", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"ignore": [ | ||
@@ -59,3 +59,2 @@ "demo", | ||
"sorcery": "^0.10.0", | ||
"tsify": "^3.0.0", | ||
"tslint": "^4.0.2", | ||
@@ -62,0 +61,0 @@ "typescript": "^2.0.3", |
@@ -44,9 +44,13 @@ import { assert } from 'chai'; | ||
describe('refresh', () => { | ||
it('should set the line-height of the terminal', () => { | ||
assert.equal(viewportElement.style.lineHeight, CHARACTER_HEIGHT + 'px'); | ||
assert.equal(terminal.rowContainer.style.lineHeight, CHARACTER_HEIGHT + 'px'); | ||
charMeasure.height = 1; | ||
viewport.refresh(); | ||
assert.equal(viewportElement.style.lineHeight, '1px'); | ||
assert.equal(terminal.rowContainer.style.lineHeight, '1px'); | ||
it('should set the line-height of the terminal', done => { | ||
// Allow CharMeasure to be initialized | ||
setTimeout(() => { | ||
assert.equal(viewportElement.style.lineHeight, CHARACTER_HEIGHT + 'px'); | ||
assert.equal(terminal.rowContainer.style.lineHeight, CHARACTER_HEIGHT + 'px'); | ||
charMeasure.height = 1; | ||
viewport.refresh(); | ||
assert.equal(viewportElement.style.lineHeight, '1px'); | ||
assert.equal(terminal.rowContainer.style.lineHeight, '1px'); | ||
done(); | ||
}, 0); | ||
}); | ||
@@ -66,15 +70,19 @@ it('should set the height of the viewport when the line-height changed', () => { | ||
describe('syncScrollArea', () => { | ||
it('should sync the scroll area', () => { | ||
terminal.lines.push(''); | ||
terminal.rows = 1; | ||
assert.equal(scrollAreaElement.style.height, 0 * CHARACTER_HEIGHT + 'px'); | ||
viewport.syncScrollArea(); | ||
assert.equal(viewportElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
assert.equal(scrollAreaElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
terminal.lines.push(''); | ||
viewport.syncScrollArea(); | ||
assert.equal(viewportElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
assert.equal(scrollAreaElement.style.height, 2 * CHARACTER_HEIGHT + 'px'); | ||
it('should sync the scroll area', done => { | ||
// Allow CharMeasure to be initialized | ||
setTimeout(() => { | ||
terminal.lines.push(''); | ||
terminal.rows = 1; | ||
assert.equal(scrollAreaElement.style.height, 0 * CHARACTER_HEIGHT + 'px'); | ||
viewport.syncScrollArea(); | ||
assert.equal(viewportElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
assert.equal(scrollAreaElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
terminal.lines.push(''); | ||
viewport.syncScrollArea(); | ||
assert.equal(viewportElement.style.height, 1 * CHARACTER_HEIGHT + 'px'); | ||
assert.equal(scrollAreaElement.style.height, 2 * CHARACTER_HEIGHT + 'px'); | ||
done(); | ||
}, 0); | ||
}); | ||
}); | ||
}); |
@@ -38,3 +38,4 @@ /** | ||
this.syncScrollArea(); | ||
// Perform this async to ensure the CharMeasure is ready. | ||
setTimeout(() => this.syncScrollArea(), 0); | ||
} | ||
@@ -41,0 +42,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25
337582
23335
1213699