diff --git a/apps/remix-ide/src/app/tabs/debugger/debuggerUI/vmDebugger/DropdownPanel.js b/apps/remix-ide/src/app/tabs/debugger/debuggerUI/vmDebugger/DropdownPanel.js index ab2adf192f..050a55872f 100644 --- a/apps/remix-ide/src/app/tabs/debugger/debuggerUI/vmDebugger/DropdownPanel.js +++ b/apps/remix-ide/src/app/tabs/debugger/debuggerUI/vmDebugger/DropdownPanel.js @@ -1,12 +1,12 @@ 'use strict' -var yo = require('yo-yo') -const copy = require('copy-text-to-clipboard') -var EventManager = require('../../../../../lib/events') -var TreeView = require('../../../../ui/TreeView') // TODO setup a direct reference to the UI components +const yo = require('yo-yo') +const copyToClipboard = require('../../../../ui/copy-to-clipboard') +const EventManager = require('../../../../../lib/events') +const TreeView = require('../../../../ui/TreeView') // TODO setup a direct reference to the UI components -var csjs = require('csjs-inject') +const csjs = require('csjs-inject') -var css = csjs` +const css = csjs` .title { display: flex; align-items: center; @@ -24,8 +24,6 @@ var css = csjs` .eyeButton { margin: 3px; } - .eyeButton:hover { - } .dropdownpanel { width: 100%; word-break: break-word; @@ -87,7 +85,7 @@ DropdownPanel.prototype.update = function (_data, _header) { this.view.querySelector('.dropdownpanel .dropdowncontent').style.display = 'block' this.view.querySelector('.dropdownpanel .dropdownrawcontent').innerText = JSON.stringify(_data, null, '\t') if (!this.displayContentOnly) { - this.view.querySelector('.title div.btn-sm').style.display = 'block' + this.view.querySelector('.title i.fa-copy').style.display = 'block' this.view.querySelector('.title span').innerText = _header || ' ' } this.message('') @@ -101,6 +99,11 @@ DropdownPanel.prototype.setContent = function (node) { yo.update(this.view, this.render(null, node)) } +DropdownPanel.prototype.copyClipboard = function () { + const content = this.view.querySelector('.dropdownpanel .dropdownrawcontent') + return content.innerText ? content.innerText : content.textContent +} + DropdownPanel.prototype.render = function (overridestyle, node) { var content = yo`