mode RunTab to a class

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent d5696f2424
commit 563e07ae16
  1. 19
      src/app/tabs/run-tab.js

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

Loading…
Cancel
Save