From b104e7c4fd2ae5715fe82243e93cd30ecad506b8 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 14 Jan 2019 18:43:40 -0500 Subject: [PATCH] refactor debugger tab --- src/app.js | 2 +- src/app/tabs/debugger-tab.js | 34 +++++----------------- src/app/tabs/styles/debugger-tab-styles.js | 14 +++++++++ 3 files changed, 22 insertions(+), 28 deletions(-) create mode 100644 src/app/tabs/styles/debugger-tab-styles.js diff --git a/src/app.js b/src/app.js index 5f8525fb05..0b22f7dc23 100644 --- a/src/app.js +++ b/src/app.js @@ -437,7 +437,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ), settings: new SettingsTab(self._components.registry), analysis: new AnalysisTab(registry), - debug: new DebuggerTab(self._components.registry), + debug: new DebuggerTab(), support: new SupportTab(), test: new TestTab(self._components.registry, compileTab) } diff --git a/src/app/tabs/debugger-tab.js b/src/app/tabs/debugger-tab.js index 53ecd48adc..c942998a24 100644 --- a/src/app/tabs/debugger-tab.js +++ b/src/app/tabs/debugger-tab.js @@ -1,43 +1,23 @@ var yo = require('yo-yo') -var csjs = require('csjs-inject') +var css = require('./styles/debugger-tab-styles') var DebuggerUI = require('../debugger/debuggerUI') -var globalRegistry = require('../../global/registry') -var EventManager = require('../../lib/events') -var styles = require('../ui/styles-guide/theme-chooser').chooser() - -const css = csjs` - .debuggerTabView { - padding: 2%; - } - .debugger { - margin-bottom: 1%; - ${styles.rightPanel.debuggerTab.box_Debugger} - } -` - class DebuggerTab { - constructor (localRegistry) { - const self = this - self.event = new EventManager() - self._view = { el: null } - self.data = {} - self._components = {} - self._components.registry = localRegistry || globalRegistry + constructor () { + this.el = null } render () { - const self = this - if (self._view.el) return self._view.el + if (this.el) return this.el - self._view.el = yo` + this.el = yo`
` - this.debuggerUI = new DebuggerUI(self._view.el.querySelector('#debugger')) - return self._view.el + this.debuggerUI = new DebuggerUI(this.el.querySelector('#debugger')) + return this.el } debugger () { diff --git a/src/app/tabs/styles/debugger-tab-styles.js b/src/app/tabs/styles/debugger-tab-styles.js new file mode 100644 index 0000000000..b23f885c71 --- /dev/null +++ b/src/app/tabs/styles/debugger-tab-styles.js @@ -0,0 +1,14 @@ +var csjs = require('csjs-inject') +var styles = require('../../ui/styles-guide/theme-chooser').chooser() + +const css = csjs` + .debuggerTabView { + padding: 2%; + } + .debugger { + margin-bottom: 1%; + ${styles.rightPanel.debuggerTab.box_Debugger} + } +` + +module.exports = css