mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-01 13:14:16 +08:00
fix(*): Fix for "apply is not a function" lost in revert of e275f35
This commit is contained in:
parent
3f258b8cf8
commit
8b1e3c185d
5 changed files with 14 additions and 10 deletions
|
@ -83,7 +83,7 @@ class N1SpecReporter extends View
|
|||
@on 'click', '.stack-trace', ->
|
||||
$(this).toggleClass('expanded')
|
||||
|
||||
@reloadButton.on 'click', -> require('electron').ipcRenderer.send('call-window-method', 'restart')
|
||||
@reloadButton.on 'click', -> require('electron').ipcRenderer.send('call-webcontents-method', 'reload')
|
||||
|
||||
reportRunnerResults: (runner) ->
|
||||
@updateSpecCounts()
|
||||
|
@ -249,7 +249,7 @@ class N1SpecReporter extends View
|
|||
specSummaryElement = $("#spec-summary-#{spec.id}")
|
||||
specSummaryElement.removeClass('pending')
|
||||
specSummaryElement.attr('title', spec.getFullName())
|
||||
|
||||
|
||||
results = spec.results()
|
||||
if results.skipped
|
||||
specSummaryElement.addClass("skipped")
|
||||
|
|
|
@ -356,9 +356,15 @@ class Application
|
|||
|
||||
ipcMain.on 'call-window-method', (event, method, args...) ->
|
||||
win = BrowserWindow.fromWebContents(event.sender)
|
||||
console.error("Method #{method} does not exist on BrowserWindow!") unless win[method]
|
||||
win[method](args...)
|
||||
|
||||
ipcMain.on 'call-devtools-webcontents-method', (event, method, args...) ->
|
||||
# If devtools aren't open the `webContents::devToolsWebContents` will be null
|
||||
event.sender.devToolsWebContents?[method](args...)
|
||||
|
||||
ipcMain.on 'call-webcontents-method', (event, method, args...) ->
|
||||
console.error("Method #{method} does not exist on WebContents!") unless event.sender[method]
|
||||
event.sender[method](args...)
|
||||
|
||||
ipcMain.on 'action-bridge-rebroadcast-to-all', (event, args...) =>
|
||||
|
|
|
@ -132,9 +132,7 @@ var hotCompile = (function () {
|
|||
}());
|
||||
|
||||
function registerHotCompile() {
|
||||
CoffeeScript.FILE_EXTENSIONS.forEach(function(ext) {
|
||||
require.extensions[ext] = hotCompile;
|
||||
});
|
||||
require.extensions['.cjsx'] = hotCompile;
|
||||
|
||||
if (process.mainModule === module) {
|
||||
var path = require('path');
|
||||
|
|
|
@ -506,7 +506,7 @@ class NylasEnvConstructor extends Model
|
|||
|
||||
# Extended: Reload the current window.
|
||||
reload: ->
|
||||
ipcRenderer.send('call-window-method', 'restart')
|
||||
ipcRenderer.send('call-webcontents-method', 'reload')
|
||||
|
||||
# Updates the window load settings - called when the app is ready to display
|
||||
# a hot-loaded window. Causes listeners registered with `onWindowPropsReceived`
|
||||
|
@ -773,15 +773,15 @@ class NylasEnvConstructor extends Model
|
|||
|
||||
# Extended: Open the dev tools for the current window.
|
||||
openDevTools: ->
|
||||
ipcRenderer.send('call-window-method', 'openDevTools')
|
||||
ipcRenderer.send('call-webcontents-method', 'openDevTools')
|
||||
|
||||
# Extended: Toggle the visibility of the dev tools for the current window.
|
||||
toggleDevTools: ->
|
||||
ipcRenderer.send('call-window-method', 'toggleDevTools')
|
||||
ipcRenderer.send('call-webcontents-method', 'toggleDevTools')
|
||||
|
||||
# Extended: Execute code in dev tools.
|
||||
executeJavaScriptInDevTools: (code) ->
|
||||
ipcRenderer.send('call-webcontents-method', 'executeJavaScriptInDevTools', code)
|
||||
ipcRenderer.send('call-devtools-webcontents-method', 'executeJavaScript', code)
|
||||
|
||||
###
|
||||
Section: Private
|
||||
|
|
|
@ -34,4 +34,4 @@ prefs.activate()
|
|||
|
||||
ipc.on 'command', (command, args) ->
|
||||
if command is 'window:toggle-dev-tools'
|
||||
ipc.send('call-window-method', 'toggleDevTools')
|
||||
ipc.send('call-webcontents-method', 'toggleDevTools')
|
||||
|
|
Loading…
Reference in a new issue