Rename App.coffee to Atom.coffee. This also required moving src/atom,spec/atom to src/app,spec/app

This commit is contained in:
Corey Johnson
2012-04-03 10:33:08 -07:00
parent e0274c293f
commit 1efb712fd3
73 changed files with 15 additions and 14 deletions

View File

@@ -0,0 +1,25 @@
$ = require 'jquery'
_ = require 'underscore'
Specificity = require 'specificity'
module.exports =
class BindingSet
selector: null
commandForEvent: null
constructor: (@selector, mapOrFunction) ->
@specificity = Specificity(@selector)
@commandForEvent = @buildEventHandler(mapOrFunction)
buildEventHandler: (mapOrFunction) ->
if _.isFunction(mapOrFunction)
mapOrFunction
else
(event) =>
for pattern, command of mapOrFunction
return command if @eventMatchesPattern(event, pattern)
null
eventMatchesPattern: (event, pattern) ->
pattern = pattern.replace(/^<|>$/g, '')
event.keystroke == pattern