diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-05-10 22:55:35 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-05-10 22:55:35 -0400 |
| commit | 792c0fa390fe23efcf98049a14b8e3880987bf30 (patch) | |
| tree | b5c3994a69e14af7ef2734ea959e108349f397eb /js/matrix.js | |
| parent | 63e1ae4898aeac4073f887bb1db9156286b08c63 (diff) | |
randomly slide the canvas
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) { |
