mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-08 12:14:03 +08:00
34 lines
646 B
JavaScript
34 lines
646 B
JavaScript
/**
|
|
* Created by nuintun on 2015/11/24.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
function addRowsOnDemand(){
|
|
while (this.y >= this.rows) {
|
|
this.lines.push(this.blankLine());
|
|
|
|
var div = document.createElement('div');
|
|
|
|
this.element.appendChild(div);
|
|
this.children.push(div);
|
|
|
|
this.rows++;
|
|
}
|
|
}
|
|
|
|
module.exports = function (Terminal){
|
|
Terminal.prototype.updateRange = function (y){
|
|
if (y < this.refreshStart) this.refreshStart = y;
|
|
|
|
if (y > this.refreshEnd) this.refreshEnd = y;
|
|
|
|
addRowsOnDemand.bind(this)();
|
|
};
|
|
|
|
Terminal.prototype.maxRange = function (){
|
|
this.refreshStart = 0;
|
|
this.refreshEnd = this.rows - 1;
|
|
};
|
|
};
|