git ssb

16+

Dominic / patchbay



Commit acb78df5849d6055ea5fc04006d5881b6629c6fd

Add context menu for electron

Charles Lehner authored on 8/2/2016, 1:37:16 AM
Dominic Tarr committed on 10/24/2016, 8:30:53 PM
Parent: 606c0def1d798cea50ee2571dcc88c642948db9e

Files changed

modules/tabs.jschanged
modules/tabs.jsView
@@ -180,8 +180,25 @@
180180 else
181181 errorsContent.appendChild(el)
182182 })
183183
184 + if (process.versions.electron) {
185 + window.addEventListener('contextmenu', function (ev) {
186 + ev.preventDefault()
187 + var remote = require('remote')
188 + var Menu = remote.require('menu')
189 + var MenuItem = remote.require('menu-item')
190 + var menu = new Menu()
191 + menu.append(new MenuItem({
192 + label: 'Inspect Element',
193 + click: function () {
194 + remote.getCurrentWindow().inspectElement(ev.x, ev.y)
195 + }
196 + }))
197 + menu.popup(remote.getCurrentWindow())
198 + })
199 + }
200 +
184201 return tabs
185202 }
186203
187204

Built with git-ssb-web