From 41832538e1b8ef8fe7e7b1d9fa14dc5e03f9e764 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 19 Sep 2018 21:14:51 -0400 Subject: [PATCH] add reset method to CodeListView --- src/app/debugger/debuggerUI/VmDebugger.js | 4 +--- src/app/debugger/debuggerUI/vmDebugger/CodeListView.js | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/debugger/debuggerUI/VmDebugger.js b/src/app/debugger/debuggerUI/VmDebugger.js index 2089642b19..0126945ca1 100644 --- a/src/app/debugger/debuggerUI/VmDebugger.js +++ b/src/app/debugger/debuggerUI/VmDebugger.js @@ -75,9 +75,7 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca this.asmCode = new CodeListView() this.vmDebuggerLogic.event.register('codeManagerChanged', this.asmCode.changed.bind(this.asmCode)) - this.vmDebuggerLogic.event.register('traceUnloaded', function () { - self.asmCode.changed([], '', -1) - }) + this.vmDebuggerLogic.event.register('traceUnloaded', this.asmCode.reset.bind(this.asmCode)) this.calldataPanel = new CalldataPanel() _parentUI.event.register('indexChanged', this, function (index) { diff --git a/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js b/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js index 0e7f929134..01d7e42354 100644 --- a/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js +++ b/src/app/debugger/debuggerUI/vmDebugger/CodeListView.js @@ -52,6 +52,10 @@ CodeListView.prototype.indexChanged = function (index) { this.codeView.scrollTop = this.itemSelected.offsetTop - parseInt(this.codeView.offsetTop) } +CodeListView.prototype.reset = function () { + this.changed([], '', -1) +} + CodeListView.prototype.changed = function (code, address, index) { if (this.address === address) { return this.indexChanged(index)