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