Commit 563e07ae authored by Iuri Matias's avatar Iuri Matias Committed by yann300

mode RunTab to a class

parent d5696f24
var $ = require('jquery') var $ = require('jquery')
var yo = require('yo-yo') var yo = require('yo-yo')
var EventManager = require('../../lib/events') var EventManager = require('../../lib/events')
var globlalRegistry = require('../../global/registry') var globalRegistry = require('../../global/registry')
var executionContext = require('../../execution-context') var executionContext = require('../../execution-context')
var Card = require('../ui/card') var Card = require('../ui/card')
var css = require('./styles/run-tab-styles') var css = require('./styles/run-tab-styles')
...@@ -15,7 +15,9 @@ var ContractDropdownUI = require('./runTab/contractDropdown.js') ...@@ -15,7 +15,9 @@ var ContractDropdownUI = require('./runTab/contractDropdown.js')
var Recorder = require('./runTab/model/recorder.js') var Recorder = require('./runTab/model/recorder.js')
var RecorderUI = require('./runTab/recorder.js') var RecorderUI = require('./runTab/recorder.js')
function runTab (opts, localRegistry) { class RunTab {
constructor (opts, localRegistry) {
var self = this var self = this
self.event = new EventManager() self.event = new EventManager()
self._view = {} self._view = {}
...@@ -25,7 +27,7 @@ function runTab (opts, localRegistry) { ...@@ -25,7 +27,7 @@ function runTab (opts, localRegistry) {
another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.` another environment. e.g Transactions created in Javascript VM can be replayed in the Injected Web3.`
} }
self._components = {} self._components = {}
self._components.registry = localRegistry || globlalRegistry self._components.registry = localRegistry || globalRegistry
self._components.transactionContextAPI = { self._components.transactionContextAPI = {
getAddress: (cb) => { getAddress: (cb) => {
cb(null, $('#txorigin').val()) cb(null, $('#txorigin').val())
...@@ -184,9 +186,13 @@ function runTab (opts, localRegistry) { ...@@ -184,9 +186,13 @@ function runTab (opts, localRegistry) {
</div> </div>
` `
container.appendChild(el) container.appendChild(el)
this.container = container
}
render () {
return this.container
}
return {
render () { return container },
profile () { profile () {
return { return {
name: 'run transactions', name: 'run transactions',
...@@ -196,7 +202,6 @@ function runTab (opts, localRegistry) { ...@@ -196,7 +202,6 @@ function runTab (opts, localRegistry) {
description: 'execute and save transactions' description: 'execute and save transactions'
} }
} }
}
} }
module.exports = runTab module.exports = RunTab
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