Commit d8d07040 authored by Iuri Matias's avatar Iuri Matias Committed by yann300

move plugin styles and refactor plugin tab

parent 32993d66
var yo = require('yo-yo')
var csjs = require('csjs-inject')
var css = require('./styles/plugin-tab-styles')
var globalRegistry = require('../../global/registry')
var EventManager = require('../../lib/events')
module.exports = class plugintab {
class PluginTab {
constructor (json, localRegistry) {
const self = this
self.event = new EventManager()
self._view = { el: null }
self.data = { json }
self._components = {}
self._components.registry = localRegistry || globalRegistry
this.event = new EventManager()
this._view = { el: null }
this.data = { json }
this._components = {}
this._components.registry = localRegistry || globalRegistry
}
render () {
const self = this
if (self._view.el) return self._view.el
self._view.el = yo`
if (this._view.el) return this._view.el
this._view.el = yo`
<div class="${css.pluginTabView}" id="pluginView">
<iframe class="${css.iframe}" src="${self.data.json.url}/index.html"></iframe>
<iframe class="${css.iframe}" src="${this.data.json.url}/index.html"></iframe>
</div>`
return self._view.el
return this._view.el
}
}
const css = csjs`
.pluginTabView {
height: 100%;
width: 100%;
}
.iframe {
height: 100%;
width: 100%;
border: 0;
}
`
module.exports = PluginTab
var csjs = require('csjs-inject')
const css = csjs`
.pluginTabView {
height: 100%;
width: 100%;
}
.iframe {
height: 100%;
width: 100%;
border: 0;
}
`
module.exports = css
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment