Last active
December 19, 2015 12:49
-
-
Save kbaum/5958155 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 Viewthespace.BuildingTrafficDashboard | |
constructor: (pusherKey, uniqueUserId) -> | |
pusher = new Pusher pusherKey | |
channel = pusher.subscribe "dashboard_results_#{uniqueUserId}" | |
dashboard = @ | |
channel.bind 'top_traffic_sources', (trafficSources) -> | |
dashboard.refreshTopTrafficSources trafficSources | |
channel.bind 'top_prospects_as_json', (topProspects) -> | |
dashboard.refreshTopProspects topProspects | |
channel.bind 'top_spaces_as_json', (topSpaces) -> | |
dashboard.refreshTopSpaces topSpaces | |
channel.bind 'day_of_week_comparison', (data) -> | |
dashboard.refreshDayOfWeekComparison data | |
channel.bind 'pusher:subscription_succeeded', -> | |
$form.trigger "submit.rails" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment