kapetan / titlebar

Emulate OS X window title bar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

created element is not a DOM node

yoshuawuyts opened this issue · comments

commented

The exposed element by titlebar() is not a DOM node:

screen shot 2015-05-29 at 15 19 05

This works fine with older methods such as Node.appendChild(), but newer methods like Node.insertBefore() don't like this.

I suspect the root issue is that the prototype is being overwritten, since domify returns proper DOM nodes. Thanks!

commented

Welp, apparently I should read code before opening an issue. - https://github.com/kapetan/titlebar/blob/master/index.js#L58-L70

Would be neat if the exposed element inherited from HTMLElement though, though I'm not sure how it'll play with the custom CSS like on titlebar.appendTo().

I don't know if that's easily possible. For now I've added the element property to the readme.

commented

I can solve it for my own project by wrapping it in a custom element, which is a higher abstraction level. It does require a using a webcomponents polyfill, so I think it's better to have that live in a separate repo.