Created
January 19, 2012 00:14
-
-
Save fletcherm/1636689 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 AcademicServicesRouter extends Backbone.Router | |
routes: | |
'records': 'records' | |
'financial_aid': 'financial_aid' | |
'admissions': 'admissions' | |
initialize: ({@view}) => | |
@view.bind 'records_selected', => @navigate('/records', true) | |
@view.bind 'financial_aid_selected', => @navigate('/financial_aid', true) | |
@view.bind 'admissions_selected', => @navigate('/admissions', true) | |
records: => @view.show_records() | |
financial_aid: => @view.show_financial_aid() | |
admissions: => @view.show_admissions() | |
class ViewThatSelectsRecordsForSomeReason extends Backbone.View | |
render: -> | |
# build @el | |
@$('.records-link').click => @trigger 'records_selected' | |
some_other_function: -> | |
@model.save( | |
success: => @trigger 'records_selected' | |
) | |
$(-> new AcademicServicesRouter(view: new ViewThatSelectsRecordsForSomeReason)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment