Skip to content

Instantly share code, notes, and snippets.

@jashkenas
Forked from edoloughlin/main_menu.coffee
Created January 13, 2011 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jashkenas/778242 to your computer and use it in GitHub Desktop.
Save jashkenas/778242 to your computer and use it in GitHub Desktop.
class MainMenu
interviewEditor = null
highlight: (menuId) ->
$('#main_menu li').removeClass('active_menu_item')
$("#main_menu li##{menuId}").addClass('active_menu_item')
clearContentArea: ->
$('div#content').children().remove()
menuClickCallback: (event) =>
event.preventDefault()
@highlight event.data.menuId
@clearContentArea()
event.data.callback()
setup: ->
interviewEditor = new InterviewEditor
$('#main_menu li#next_interview a').bind 'click',
{ callback: nextInterview, menuId: '#next_interview' },
@menuClickCallback
$('#main_menu li#manage_interviews a').bind 'click',
{ callback: manageInterviews, menuId: '#manage_interviews' },
@menuClickCallback
$('#main_menu li#setup_interview a').bind 'click',
{ callback: interviewEditor.setupInterview, menuId: '#setup_interview' },
@menuClickCallback
$('#main_menu li#manage_account a').bind 'click',
{ callback: manageAccount, menuId: '#manage_account' },
@menuClickCallback
$('#main_menu li#manage_interviews a').click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment