meshviewer/lib/container.js

21 lines
313 B
JavaScript
Raw Normal View History

2015-03-25 23:33:11 +00:00
define([], function () {
2015-07-08 19:28:26 +00:00
return function (tag) {
if (!tag)
tag = "div"
2015-03-25 23:33:11 +00:00
var self = this
2015-07-08 19:28:26 +00:00
var container = document.createElement(tag)
2015-03-25 23:33:11 +00:00
self.add = function (d) {
d.render(container)
}
self.render = function (el) {
el.appendChild(container)
}
return self
}
})