added context to menuicons

pull/751/head
LianaHus 4 years ago committed by Liana Husikyan
parent acb9e5892a
commit 67783eab10
  1. 13
      apps/remix-ide/src/app/components/vertical-icons.js

@ -4,9 +4,10 @@ var yo = require('yo-yo')
var csjs = require('csjs-inject') var csjs = require('csjs-inject')
var helper = require('../../lib/helper') var helper = require('../../lib/helper')
const globalRegistry = require('../../global/registry') const globalRegistry = require('../../global/registry')
const contextMenu = require('../ui/contextMenu')
const { Plugin } = require('@remixproject/engine') const { Plugin } = require('@remixproject/engine')
const EventEmitter = require('events') const EventEmitter = require('events')
let VERTICALMENU_HANDLE
const profile = { const profile = {
name: 'menuicons', name: 'menuicons',
@ -72,6 +73,7 @@ export class VerticalIcons extends Plugin {
onclick="${() => { this.toggle(name) }}" onclick="${() => { this.toggle(name) }}"
plugin="${name}" plugin="${name}"
title="${title}" title="${title}"
oncontextmenu="${(e) => this.itemContextMenu(e, name)}"
data-id="verticalIconsKind${name}"> data-id="verticalIconsKind${name}">
<img class="image" src="${icon}" alt="${name}" /> <img class="image" src="${icon}" alt="${name}" />
</div>` </div>`
@ -221,6 +223,15 @@ export class VerticalIcons extends Plugin {
} }
} }
itemContextMenu (e, name) {
console.log(name)
VERTICALMENU_HANDLE && VERTICALMENU_HANDLE.hide(null, true)
const actions = {}
actions['Deactivate'] = () => { this.call('manager', 'deactivatePlugin', name) }
VERTICALMENU_HANDLE = contextMenu(e, actions)
e.preventDefault()
}
render () { render () {
const home = yo` const home = yo`
<div <div

Loading…
Cancel
Save