Remove meta-o handler from window.

This commit is contained in:
Corey Johnson
2011-12-22 14:58:34 -08:00
parent ee0bf2e553
commit b15c493693
2 changed files with 1 additions and 29 deletions

View File

@@ -13,28 +13,3 @@ describe "Window", ->
spyOn(window.editor, 'save')
window.keydown 'meta+s'
expect(window.editor.save).toHaveBeenCalled()
describe 'meta+o', ->
selectedFilePath = null
beforeEach ->
spyOn(atom.native, 'openPanel').andCallFake ->
selectedFilePath
it 'presents an open dialog', ->
window.keydown 'meta+o'
expect(atom.native.openPanel).toHaveBeenCalled()
describe 'when a url is chosen', ->
it 'opens the url in the editor', ->
selectedFilePath = require.resolve 'fixtures/sample.txt'
spyOn(window.editor, 'open').andCallFake (url) -> url
window.keydown 'meta+o'
expect(window.editor.open).toHaveBeenCalledWith(selectedFilePath)
describe 'when dialog is canceled', ->
it 'does not open the editor', ->
selectedFilePath = null
spyOn(window.editor, 'open').andCallFake()
window.keydown 'meta+o'
expect(window.editor.open).not.toHaveBeenCalled()

View File

@@ -26,10 +26,7 @@ windowAdditions =
$(document).bind 'keydown', (event) =>
if String.fromCharCode(event.which) == 'S' and event.metaKey
@editor.save()
if String.fromCharCode(event.which) == 'O' and event.metaKey
url = atom.native.openPanel()
@editor.open(url) if url
false
unbindKeys: ->
$(document).unbind 'keydown'