Skip to content

Commit

Permalink
Merge pull request #32 from jisaacks/master
Browse files Browse the repository at this point in the history
Allow user to specify what the containing element should be when creating a new instance.
  • Loading branch information
wavded committed Nov 19, 2012
2 parents 9ddeb61 + 5cfd352 commit 0df0805
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion humane.js
Expand Up @@ -53,6 +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


try { this._setupEl() } // attempt to setup elements try { this._setupEl() } // attempt to setup elements
catch (e) { catch (e) {
Expand All @@ -65,7 +66,7 @@
_setupEl: function () { _setupEl: function () {
var el = doc.createElement('div') var el = doc.createElement('div')
el.style.display = 'none' el.style.display = 'none'
doc.body.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)
this.transEvent = ENV.bind(this._afterAnimation,this) this.transEvent = ENV.bind(this._afterAnimation,this)
Expand Down

0 comments on commit 0df0805

Please sign in to comment.