Skip to content

Instantly share code, notes, and snippets.

@linus-amg
Created December 30, 2014 14:44
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 linus-amg/9e94082ee8220f388257 to your computer and use it in GitHub Desktop.
Save linus-amg/9e94082ee8220f388257 to your computer and use it in GitHub Desktop.
application coffee
Controller = require 'controller.coffee'
Router = require 'router.coffee'
Components = require 'components/index.coffee'
require 'handlebars/helpers/index.coffee'
module.exports = App = new Marionette.Application()
App.addRegions
header: '#header-region'
main: '#main-region'
dialogs: '#dialog-region'
App.addInitializer ->
Router = App.Router = new Router
controller: new Controller
App: App
Backbone.history.start pushState: true
$(document).on 'click', 'a', (e) ->
if !$(@).attr('data-toggle')
href = $(@).attr('href') || '/'
App.Router.navigate href, true
return false
$(document).ready ->
App.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment