Merge pull request #1963 from ethereum/issue#1962-hidden_panel

Create an hidden panel component
pull/3094/head
yann300 6 years ago committed by GitHub
commit 04d8ead4f8
  1. 3
      src/app.js
  2. 23
      src/app/components/hidden-panel.js
  3. 2
      src/app/components/local-plugin.js
  4. 3
      src/app/components/swap-panel.js

@ -51,6 +51,7 @@ import { ThemeModule } from './app/tabs/theme-module'
import { NetworkModule } from './app/tabs/network-module' import { NetworkModule } from './app/tabs/network-module'
import { SwapPanel } from './app/components/swap-panel' import { SwapPanel } from './app/components/swap-panel'
import { MainPanel } from './app/components/main-panel' import { MainPanel } from './app/components/main-panel'
import { HiddenPanel } from './app/components/hidden-panel'
import { VerticalIcons } from './app/components/vertical-icons' import { VerticalIcons } from './app/components/vertical-icons'
var css = csjs` 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 swapPanel = new SwapPanel(appStore)
const mainPanel = new MainPanel(appStore) const mainPanel = new MainPanel(appStore)
const hiddenPanel = new HiddenPanel(appStore)
// ----------------- main view ---------------------- // ----------------- main view ----------------------
self._components.mainview = new MainView(appStore, appManager, mainPanel) 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.mainpanel.appendChild(self._components.mainview.render())
self._view.iconpanel.appendChild(verticalIcons.render()) self._view.iconpanel.appendChild(verticalIcons.render())
self._view.swappanel.appendChild(swapPanel.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() let filePanel = new FilePanel()
registry.put({api: filePanel, name: 'filepanel'}) registry.put({api: filePanel, name: 'filepanel'})

@ -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`
<div class=${css.pluginsContainer}>
${this.view}
</div>`
}
}

@ -164,7 +164,7 @@ module.exports = class LocalPlugin {
<label for="loc2"><input type="radio" name="location" onclick="${e => this.updateLoc(e)}" value="mainPanel" id="loc2" >Main Panel</label> <label for="loc2"><input type="radio" name="location" onclick="${e => this.updateLoc(e)}" value="mainPanel" id="loc2" >Main Panel</label>
</div> </div>
<div class="radio"> <div class="radio">
<label for="loc3"><input type="radio" name="location" onclick="${e => this.updateLoc(e)}" value="none" id="loc3" >None</label> <label for="loc3"><input type="radio" name="location" onclick="${e => this.updateLoc(e)}" value="hiddenPanel" id="loc3" >None</label>
</div> </div>
</form>` </form>`
} }

@ -31,8 +31,7 @@ const css = csjs`
` `
const options = { const options = {
default: true, default: true
displayHeader: true
} }
export class SwapPanel extends AbstractPanel { export class SwapPanel extends AbstractPanel {

Loading…
Cancel
Save