Commit 6b419928e2e49bc866e8d0b72330f7c9aa29b015
update @cel's context menu to work with latest electron
Dominic Tarr committed on 10/24/2016, 8:37:32 PMParent: acb78df5849d6055ea5fc04006d5881b6629c6fd
Files changed
modules/tabs.js | changed |
modules/tabs.js | |||
---|---|---|---|
@@ -166,13 +166,15 @@ | |||
166 | 166 … | window.removeEventListener('error', window.onError) | |
167 | 167 … | delete window.onError | |
168 | 168 … | } | |
169 | 169 … | ||
170 … | + var errors = h('div.errors', {id: 'errors'}) | ||
171 … | + | ||
170 | 172 … | // put errors in a tab | |
171 | 173 … | window.addEventListener('error', function (ev) { | |
172 | 174 … | var err = ev.error || ev | |
173 | 175 … | if(!tabs.has('errors')) | |
174 | - tabs.add('errors', errors, false) | ||
176 … | + tabs.add(errors, false) | ||
175 | 177 … | var el = h('div.message', | |
176 | 178 … | h('strong', err.message), | |
177 | 179 … | h('pre', err.stack)) | |
178 | 180 … | if (errorsContent.firstChild) | |
@@ -183,11 +185,11 @@ | |||
183 | 185 … | ||
184 | 186 … | if (process.versions.electron) { | |
185 | 187 … | window.addEventListener('contextmenu', function (ev) { | |
186 | 188 … | 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 | ||
190 | 192 … | var menu = new Menu() | |
191 | 193 … | menu.append(new MenuItem({ | |
192 | 194 … | label: 'Inspect Element', | |
193 | 195 … | click: function () { | |
@@ -208,4 +210,5 @@ | |||
208 | 210 … | ||
209 | 211 … | ||
210 | 212 … | ||
211 | 213 … | ||
214 … | + | ||
Built with git-ssb-web