git ssb

16+

Dominic / patchbay



Commit 6b419928e2e49bc866e8d0b72330f7c9aa29b015

update @cel's context menu to work with latest electron

Dominic Tarr committed on 10/24/2016, 8:37:32 PM
Parent: acb78df5849d6055ea5fc04006d5881b6629c6fd

Files changed

modules/tabs.jschanged
modules/tabs.jsView
@@ -166,13 +166,15 @@
166166 window.removeEventListener('error', window.onError)
167167 delete window.onError
168168 }
169169
170 + var errors = h('div.errors', {id: 'errors'})
171 +
170172 // put errors in a tab
171173 window.addEventListener('error', function (ev) {
172174 var err = ev.error || ev
173175 if(!tabs.has('errors'))
174- tabs.add('errors', errors, false)
176 + tabs.add(errors, false)
175177 var el = h('div.message',
176178 h('strong', err.message),
177179 h('pre', err.stack))
178180 if (errorsContent.firstChild)
@@ -183,11 +185,11 @@
183185
184186 if (process.versions.electron) {
185187 window.addEventListener('contextmenu', function (ev) {
186188 ev.preventDefault()
187- var remote = require('remote')
188- var Menu = remote.require('menu')
189- var MenuItem = remote.require('menu-item')
189 + var remote = require('electron').remote
190 + var Menu = remote.Menu
191 + var MenuItem = remote.MenuItem
190192 var menu = new Menu()
191193 menu.append(new MenuItem({
192194 label: 'Inspect Element',
193195 click: function () {
@@ -208,4 +210,5 @@
208210
209211
210212
211213
214 +

Built with git-ssb-web