]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Fix wrong behavior of fit add-on
authorparis <pariskasidiaris@gmail.com>
Sat, 16 Aug 2014 03:25:13 +0000 (03:25 +0000)
committerparis <pariskasidiaris@gmail.com>
Sat, 16 Aug 2014 03:25:13 +0000 (03:25 +0000)
addons/fit/fit.js

index 0b0eb1409d088f1da73d1d10d3ca44bc04bfe9f2..c91990c01035dd307235ea03463f5c5c55188b02 100644 (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);
-}
\ No newline at end of file
+};
\ No newline at end of file