gitlab-org--gitlab-foss/app/assets/javascripts/dispatcher.js.coffee
2013-05-02 11:46:45 +03:00

19 lines
543 B
CoffeeScript

$ ->
new Dispatcher()
class Dispatcher
constructor: () ->
page = $('body').attr('data-page')
console.log(page)
switch page
when 'issues:index' then Issues.init()
when 'dashboard:show' then dashboardPage()
when 'commit:show' then Commit.init()
when 'groups:show', 'teams:show', 'projects:show'
Pager.init(20, true)
when 'projects:new', 'projects:edit'
new Projects()
when 'admin:teams:show', 'admin:groups:show', 'admin:logs:show', 'admin:users:new'
Admin.init()