summaryrefslogtreecommitdiff
path: root/js/matrix.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-05-10 22:55:35 -0400
committerJules Laplace <jules@okfoc.us>2016-05-10 22:55:35 -0400
commit792c0fa390fe23efcf98049a14b8e3880987bf30 (patch)
treeb5c3994a69e14af7ef2734ea959e108349f397eb /js/matrix.js
parent63e1ae4898aeac4073f887bb1db9156286b08c63 (diff)
randomly slide the canvas
Diffstat (limited to 'js/matrix.js')
-rw-r--r--js/matrix.js3
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) {