2016-07-28 18:21:50 +00:00
|
|
|
|
2018-06-26 18:35:12 +00:00
|
|
|
module.exports.init = function(data) {
|
2016-07-28 18:21:50 +00:00
|
|
|
var element = document.createElement('div')
|
|
|
|
element.innerHTML = data.html
|
|
|
|
element.id = data.graphic.name
|
|
|
|
element.classList.add('root-element')
|
|
|
|
|
|
|
|
var styleElement = document.createElement('style')
|
|
|
|
styleElement.setAttribute('type', 'text/css')
|
|
|
|
styleElement.innerHTML = data.css
|
|
|
|
|
|
|
|
element.tag = styleElement
|
|
|
|
|
|
|
|
document.body.appendChild(element)
|
|
|
|
document.head.appendChild(styleElement)
|
|
|
|
|
|
|
|
window.setTimeout(function (){
|
|
|
|
element.classList.add('root-element-display')
|
|
|
|
}, 100)
|
|
|
|
}
|
2018-06-26 18:35:12 +00:00
|
|
|
|
|
|
|
module.exports.update = function() {
|
|
|
|
|
|
|
|
}
|