Fix wrong behavior of fit add-on

This commit is contained in:
paris
2014-08-16 03:25:13 +00:00
parent 561fc59dbc
commit d12406bedc
+4 -3
View File
@@ -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);
}
};