meshviewer/lib/container.js

23 lines
356 B
JavaScript
Raw Permalink Normal View History

2015-03-25 23:33:11 +00:00
define([], function () {
'use strict';
2016-05-27 21:59:01 +00:00
2015-07-08 19:28:26 +00:00
return function (tag) {
if (!tag) {
tag = 'div';
}
2015-07-08 19:28:26 +00:00
var self = this;
var container = document.createElement(tag);
2015-03-25 23:33:11 +00:00
self.add = function add(d) {
d.render(container);
};
2015-03-25 23:33:11 +00:00
self.render = function render(el) {
el.appendChild(container);
};
2015-03-25 23:33:11 +00:00
return self;
};
});