Created
December 30, 2014 14:44
-
-
Save linus-amg/9e94082ee8220f388257 to your computer and use it in GitHub Desktop.
application coffee
This file contains 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
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