update files

This commit is contained in:
nuintun
2015-11-25 22:44:15 +08:00
parent ec262a50e0
commit d079b9bf16
4 changed files with 44 additions and 25 deletions

View File

@@ -0,0 +1,26 @@
/**
* Created by nuintun on 2015/11/24.
*/
'use strict';
module.exports = function (Terminal){
Terminal.prototype.close = function (){
this.lines = [];
this.children = [];
this.readable = false;
this.writable = false;
this.handler = function (){};
this.write = function (){};
if (this.element) {
var parent = this.element.parentNode;
if (parent) {
parent.removeChild(this.element);
}
this.element = null;
}
};
};

View File

@@ -1,18 +0,0 @@
/**
* Created by nuintun on 2015/11/24.
*/
'use strict';
module.exports = function (Terminal){
Terminal.prototype.destroy = function (){
this.readable = false;
this.writable = false;
this.handler = function (){};
this.write = function (){};
if (this.element.parentNode) {
this.element.parentNode.removeChild(this.element);
}
};
};

View File

@@ -7,10 +7,23 @@
module.exports = function (Terminal){
// ESC c Full Reset (RIS).
Terminal.prototype.reset = function (){
this.options.rows = this.rows;
this.options.cols = this.cols;
var parent;
if (this.element) {
parent = this.element.parentNode;
if (parent) {
parent.removeChild(this.element);
}
}
Terminal.call(this, this.options);
this.open();
this.refresh(0, this.rows - 1);
if (parent) {
parent.appendChild(this.element);
}
};
};