testTab: refactor prepare class

pull/1/head
serapath 7 years ago
parent 00a9480906
commit 2e79287291
  1. 13
      src/app/tabs/test-tab.js

@ -8,7 +8,7 @@ function append (container, txt) {
container.appendChild(child)
}
function testTabView (api) {
function render (api) {
var container = yo`<div class="tests" id="tests"></div>`
let testCallback = function (result) {
@ -87,7 +87,7 @@ function testTabView (api) {
}
function testTab (api = {}, events = {}, opts = {}) {
let el = testTabView(api)
let el = render(api)
let gitterIsLoaded = false
events.app.register('tabChanged', (tabName) => {
@ -95,7 +95,7 @@ function testTab (api = {}, events = {}, opts = {}) {
return
}
yo.update(el, testTabView(api))
yo.update(el, render(api))
el.style.display = 'block'
gitterIsLoaded = true
})
@ -103,4 +103,9 @@ function testTab (api = {}, events = {}, opts = {}) {
return { render () { return el } }
}
module.exports = testTab
const prototype = {
constructor: testTab,
render: render
}
prototype.constructor.prototype = prototype
module.exports = prototype.constructor

Loading…
Cancel
Save