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