From 48bb943f4d626edf4c64ef9409a71b70ef557e88 Mon Sep 17 00:00:00 2001 From: Grandschtroumpf Date: Mon, 13 May 2019 10:12:47 +0200 Subject: [PATCH] Create an hidden panel component --- src/app.js | 3 +++ src/app/components/hidden-panel.js | 23 +++++++++++++++++++++++ src/app/components/local-plugin.js | 2 +- src/app/components/swap-panel.js | 3 +-- 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 src/app/components/hidden-panel.js diff --git a/src/app.js b/src/app.js index 545677e4d3..637ae1acda 100644 --- a/src/app.js +++ b/src/app.js @@ -51,6 +51,7 @@ import { ThemeModule } from './app/tabs/theme-module' import { NetworkModule } from './app/tabs/network-module' import { SwapPanel } from './app/components/swap-panel' import { MainPanel } from './app/components/main-panel' +import { HiddenPanel } from './app/components/hidden-panel' import { VerticalIcons } from './app/components/vertical-icons' var css = csjs` @@ -344,6 +345,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org const swapPanel = new SwapPanel(appStore) const mainPanel = new MainPanel(appStore) + const hiddenPanel = new HiddenPanel(appStore) // ----------------- main view ---------------------- self._components.mainview = new MainView(appStore, appManager, mainPanel) @@ -376,6 +378,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org self._view.mainpanel.appendChild(self._components.mainview.render()) self._view.iconpanel.appendChild(verticalIcons.render()) self._view.swappanel.appendChild(swapPanel.render()) + document.body.appendChild(hiddenPanel.render()) // Hidden Panel is display none, it can be directly on body let filePanel = new FilePanel() registry.put({api: filePanel, name: 'filepanel'}) diff --git a/src/app/components/hidden-panel.js b/src/app/components/hidden-panel.js new file mode 100644 index 0000000000..5b310fc449 --- /dev/null +++ b/src/app/components/hidden-panel.js @@ -0,0 +1,23 @@ +import { AbstractPanel } from './panel' +const csjs = require('csjs-inject') +const yo = require('yo-yo') + +const css = csjs` + .pluginsContainer { + display: none; + } +` + +export class HiddenPanel extends AbstractPanel { + + constructor (appStore) { + super('hiddenPanel', appStore) + } + + render () { + return yo` +
+ ${this.view} +
` + } +} diff --git a/src/app/components/local-plugin.js b/src/app/components/local-plugin.js index 1159413102..57fa0c8542 100644 --- a/src/app/components/local-plugin.js +++ b/src/app/components/local-plugin.js @@ -164,7 +164,7 @@ module.exports = class LocalPlugin {
- +
` } diff --git a/src/app/components/swap-panel.js b/src/app/components/swap-panel.js index 1f7de07c88..215805c56c 100644 --- a/src/app/components/swap-panel.js +++ b/src/app/components/swap-panel.js @@ -31,8 +31,7 @@ const css = csjs` ` const options = { - default: true, - displayHeader: true + default: true } export class SwapPanel extends AbstractPanel {