mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
fix dom event binding in modals
This commit is contained in:
@@ -32,8 +32,6 @@ class ModalSelector extends Modal
|
||||
style.appendChild rules
|
||||
head.appendChild style
|
||||
|
||||
$('#modal-selector input').live 'keydown.modal-selector', @onKeydown
|
||||
|
||||
onKeydown: (e) =>
|
||||
keys = up: 38, down: 40, enter: 13
|
||||
|
||||
@@ -50,6 +48,7 @@ class ModalSelector extends Modal
|
||||
show: ->
|
||||
super
|
||||
@filter()
|
||||
$('#modal-selector input').live 'keydown.modal-selector', @onKeydown
|
||||
|
||||
hide: ->
|
||||
super
|
||||
|
||||
@@ -24,13 +24,13 @@ class Modal
|
||||
style.appendChild rules
|
||||
head.appendChild style
|
||||
|
||||
$(window).bind 'resize.modal', => @resize()
|
||||
|
||||
show: ->
|
||||
@showing = true
|
||||
|
||||
$('body').append('<div id="modal-overlay"></div>')
|
||||
|
||||
$(window).bind 'resize.modal', => @resize()
|
||||
|
||||
$(document).bind 'keydown.modal', (e) =>
|
||||
if e.keyCode is (esc = 27) then @hide(); false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user