diff options
Diffstat (limited to 'js/matrix.js')
| -rw-r--r-- | js/matrix.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/js/matrix.js b/js/matrix.js index de59e17..1aeb929 100644 --- a/js/matrix.js +++ b/js/matrix.js @@ -58,7 +58,7 @@ Matrix.prototype.demolish = function (){ this.forEach(function(lex){ lex.demolish() }) - while (this.rapper.firstChild) { + while (this.rapper && this.rapper.firstChild) { this.rapper.removeChild(this.rapper.firstChild); } this.aa.forEach(function(row){ @@ -124,6 +124,7 @@ Matrix.prototype.build = function(){ } Matrix.prototype.append = function(rapper){ rapper = this.rapper = rapper || this.rapper + if (! this.rapper) return this.aa.forEach(function(row, y){ var div = document.createElement("div") row.forEach(function(lex, x) { |
