fix(*): Fix for "apply is not a function" lost in revert of e275f35

This commit is contained in:
Ben Gotow 2015-12-10 14:12:04 -08:00
parent 35e45032ec
commit d2db9e1a5d
5 changed files with 14 additions and 10 deletions

View file

@ -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")

View file

@ -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...) =>

View file

@ -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');

View file

@ -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

View file

@ -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')