move plugin styles and refactor plugin tab

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 32993d667a
commit d8d0704031
  1. 42
      src/app/tabs/plugin-tab.js
  2. 15
      src/app/tabs/styles/plugin-tab-styles.js

@ -1,36 +1,30 @@
var yo = require('yo-yo') var yo = require('yo-yo')
var csjs = require('csjs-inject') var css = require('./styles/plugin-tab-styles')
var globalRegistry = require('../../global/registry') var globalRegistry = require('../../global/registry')
var EventManager = require('../../lib/events') var EventManager = require('../../lib/events')
module.exports = class plugintab { class PluginTab {
constructor (json, localRegistry) { constructor (json, localRegistry) {
const self = this this.event = new EventManager()
self.event = new EventManager() this._view = { el: null }
self._view = { el: null } this.data = { json }
self.data = { json } this._components = {}
self._components = {} this._components.registry = localRegistry || globalRegistry
self._components.registry = localRegistry || globalRegistry
} }
render () { render () {
const self = this if (this._view.el) return this._view.el
if (self._view.el) return self._view.el
self._view.el = yo` this._view.el = yo`
<div class="${css.pluginTabView}" id="pluginView"> <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>` </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

@ -0,0 +1,15 @@
var csjs = require('csjs-inject')
const css = csjs`
.pluginTabView {
height: 100%;
width: 100%;
}
.iframe {
height: 100%;
width: 100%;
border: 0;
}
`
module.exports = css
Loading…
Cancel
Save