Created
May 7, 2012 14:10
-
-
Save shanemcd/2627999 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
| window.App = | |
| Models: {} | |
| Collections: {} | |
| Views: {} | |
| Routers: {} | |
| init: (options) -> | |
| App.project = options.project | |
| App.question_set = options.question_set | |
| App.router = new App.Routers.QuestionsRouter() | |
| Backbone.history.start(); | |
| class App.Routers.QuestionsRouter extends Backbone.Router | |
| routes: | |
| "": "index" | |
| "test": "test" | |
| test: -> | |
| console.log "test | |
| # The function that creates the view. | |
| addNewQuestion: (e) -> | |
| e.stopPropagation() | |
| new_question = new App.Views.AddQuestion() | |
| new_question.render() | |
| $("#app").html(new_question.el) | |
| # The view that is created. | |
| class App.Views.AddQuestion extends Backbone.View | |
| template: JST['question/add_question'] | |
| initialize: -> | |
| App.router.navigate("test", {trigger: true}) | |
| render: -> | |
| $("#content-container").hide() | |
| @$el.html(@template()) | |
| return @ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment