mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Remove meta-o handler from window.
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user