Skip to content

Commit

Permalink
fixed; appendChild of null error
Browse files Browse the repository at this point in the history
GH #36
  • Loading branch information
wavded committed Jan 10, 2013
1 parent 1cc233b commit 2dc08cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion humane.js
Expand Up @@ -53,7 +53,7 @@
this.waitForMove = o.waitForMove || false this.waitForMove = o.waitForMove || false
this.clickToClose = o.clickToClose || false this.clickToClose = o.clickToClose || false
this.forceNew = o.forceNew || false this.forceNew = o.forceNew || false
this.container = o.container || doc.body this.container = o.container


try { this._setupEl() } // attempt to setup elements try { this._setupEl() } // attempt to setup elements
catch (e) { catch (e) {
Expand All @@ -66,6 +66,7 @@
_setupEl: function () { _setupEl: function () {
var el = doc.createElement('div') var el = doc.createElement('div')
el.style.display = 'none' el.style.display = 'none'
if (!this.container) this.container = doc.body
this.container.appendChild(el) this.container.appendChild(el)
this.el = el this.el = el
this.removeEvent = ENV.bind(this.remove,this) this.removeEvent = ENV.bind(this.remove,this)
Expand Down
9 changes: 9 additions & 0 deletions test/issue36.html
@@ -0,0 +1,9 @@
<html>
<head>
<link href='../themes/bigbox.css' rel='stylesheet'>
<script src='../humane.js'></script>
</head>
<script>
humane.log("Hello");
</script>
</html>

0 comments on commit 2dc08cc

Please sign in to comment.