Last active
December 11, 2015 06:09
-
-
Save jeffrydegrande/4557253 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Ajax | |
@getJSON: (url, event)-> | |
$.getJSON url, (data)-> | |
Event.trigger(event, data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Event | |
@on: (event, fn)-> | |
$('body').bind event, (_, data) -> fn(data) | |
@trigger: (event, data)-> | |
$('body').trigger(event, [data]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tracker | |
@fetchAll: -> | |
Ajax.getJSON "/current_positions", "trackers:ready" | |
@fetchByUIN: (uin)-> | |
Ajax.getJSON "/trackers/#{uin}", "tracker:ready" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment