wavded/humane-js

Option to manually attach humane div.

rquast opened this issue · 2 comments

I'm using humane with Aurelia, and found that humane attaches its div to the body of the dom. However, Aurelia will replace all of the contents inside body with its own, which orphans the div.

Aurelia uses system-js, so there's not a whole lot of control over when you can make it run.

Would it be possible to have an init() option or something similar?

@rquast you can pass a container to use instead of the body

https://github.com/wavded/humane-js/blob/master/humane.js#L57

@rquast there is a create which worked for me
https://github.com/wavded/humane-js/blob/master/humane.js#L235

import Humane from 'wavded/humane-js';
import {inject} from 'aurelia-framework';
@inject(Humane)
export class Notification {
  constructor(humane) {
    this.humane = humane.create();
  }
  show(msg) {
    this.humane.log(msg);
  }
}