From 588c749934cdbef9cf7ae92cdaa8a44ec6fa260b Mon Sep 17 00:00:00 2001 From: Ravi Vagadia Date: Mon, 25 Dec 2017 11:06:10 +0530 Subject: [PATCH] issue-612 - grey out content instead of showing loader. added a new function setUpdating in DropdownPanel which greys out conent of dropdown while its waiting for updated value. --- remix-debugger/src/ui/DropdownPanel.js | 7 +++++++ remix-debugger/src/ui/SolidityLocals.js | 3 +-- remix-debugger/src/ui/SolidityState.js | 3 +-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/remix-debugger/src/ui/DropdownPanel.js b/remix-debugger/src/ui/DropdownPanel.js index 6fa484f51e..8a202c9ea0 100644 --- a/remix-debugger/src/ui/DropdownPanel.js +++ b/remix-debugger/src/ui/DropdownPanel.js @@ -67,10 +67,17 @@ DropdownPanel.prototype.setLoading = function () { } } +DropdownPanel.prototype.setUpdating = function () { + if (this.view) { + this.view.querySelector('.dropdownpanel .dropdowncontent').style.color = 'gray' + } +} + DropdownPanel.prototype.update = function (_data, _header) { if (this.view) { this.view.querySelector('.dropdownpanel .fa-refresh').style.display = 'none' this.view.querySelector('.dropdownpanel .dropdowncontent').style.display = 'block' + this.view.querySelector('.dropdownpanel .dropdowncontent').style.color = 'black' this.view.querySelector('.dropdownpanel .dropdownrawcontent').innerText = JSON.stringify(_data, null, '\t') this.view.querySelector('.dropdownpanel button.btn').style.display = 'block' this.view.querySelector('.title span').innerText = _header || ' ' diff --git a/remix-debugger/src/ui/SolidityLocals.js b/remix-debugger/src/ui/SolidityLocals.js index b5e5a26f79..3b8f6d91e0 100644 --- a/remix-debugger/src/ui/SolidityLocals.js +++ b/remix-debugger/src/ui/SolidityLocals.js @@ -33,7 +33,6 @@ class SolidityLocals { init () { var decodeTimeout = null this.parent.event.register('sourceLocationChanged', this, (sourceLocation) => { - this.basicPanel.setMessage('') if (!this.storageResolver) { this.basicPanel.setMessage('storage not ready') return @@ -41,7 +40,7 @@ class SolidityLocals { if (decodeTimeout) { window.clearTimeout(decodeTimeout) } - this.basicPanel.setLoading() + this.basicPanel.setUpdating() decodeTimeout = setTimeout(() => { decode(this, sourceLocation) }, 500) diff --git a/remix-debugger/src/ui/SolidityState.js b/remix-debugger/src/ui/SolidityState.js index 7c1d77c2fe..f69fc045f4 100644 --- a/remix-debugger/src/ui/SolidityState.js +++ b/remix-debugger/src/ui/SolidityState.js @@ -38,7 +38,6 @@ SolidityState.prototype.init = function () { var self = this var decodeTimeout = null this.parent.event.register('indexChanged', this, function (index) { - self.basicPanel.setMessage('') if (index < 0) { self.basicPanel.setMessage('invalid step index') return @@ -56,7 +55,7 @@ SolidityState.prototype.init = function () { if (decodeTimeout) { window.clearTimeout(decodeTimeout) } - self.basicPanel.setLoading() + self.basicPanel.setUpdating() decodeTimeout = setTimeout(() => { decode(self, index) }, 500)