GlobalKeymap favor most recently declared bindings in case of tie

Just like in CSS, when multiple equally-specific selectors match an
element, we favor the most recently declared one, so keybindings
cascade.
This commit is contained in:
Nathan Sobo
2012-01-12 16:35:10 -08:00
parent 5951d6e5af
commit ee068a4b84
2 changed files with 41 additions and 17 deletions

View File

@@ -10,7 +10,7 @@ class GlobalKeymap
@bindingSets = []
bindKeys: (selector, bindings) ->
@bindingSets.push(new BindingSet(selector, bindings))
@bindingSets.unshift(new BindingSet(selector, bindings))
handleKeyEvent: (event) ->
currentNode = $(event.target)