From d12406bedc589e2b7b57c64b1424e7bc38f29c0c Mon Sep 17 00:00:00 2001 From: paris Date: Sat, 16 Aug 2014 03:25:13 +0000 Subject: [PATCH] Fix wrong behavior of fit add-on --- addons/fit/fit.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/fit/fit.js b/addons/fit/fit.js index 0b0eb140..c91990c0 100644 --- a/addons/fit/fit.js +++ b/addons/fit/fit.js @@ -12,7 +12,7 @@ * of columns) */ Terminal.prototype.fit = function () { - var container = this.element.parentElement, + var container = this.rowContainer, subjectRow = this.rowContainer.firstElementChild, rows = parseInt(container.offsetHeight / subjectRow.offsetHeight), characterWidth, @@ -22,7 +22,8 @@ Terminal.prototype.fit = function () { characterWidth = parseInt(subjectRow.offsetWidth / this.cols); subjectRow.style.display = ''; - cols = parseInt(container.offsetWidth / characterWidth); + cols = container.offsetWidth / characterWidth; + cols = parseInt(cols); this.resize(cols, rows); -} \ No newline at end of file +}; \ No newline at end of file