Last active
August 29, 2015 14:02
-
-
Save jedmund/d0e6db2ae402a6206920 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
| Uncaught TypeError: undefined is not a function backbone.marionette.js?body=1:22 | |
| ------------------------------------------------------------------------------------------ | |
| c.extend.add backbone.marionette.js?body=1:22 | |
| c.extend.addInitializer backbone.marionette.js?body=1:22 | |
| (anonymous function) main.js?body=1:8 | |
| Uncaught TypeError: undefined is not a function backbone.marionette.js?body=1:22 | |
| ------------------------------------------------------------------------------------------ | |
| c.extend.add backbone.marionette.js?body=1:22 | |
| c.extend.addInitializer backbone.marionette.js?body=1:22 | |
| (anonymous function) unauthenticated.js?body=1:26 |
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
| Maitsu.Views.Layouts.Unauthenticated = Backbone.Marionette.LayoutView.extend({ | |
| template: 'layouts/unauthenticated', | |
| regions: { | |
| tabContent: '#tab-content' | |
| }, | |
| views: {}, | |
| events: { | |
| 'click ul.nav-tabs li a' : 'switchViews' | |
| }, | |
| onShow: function() { | |
| this.views.login = Maitsu.Views.Unauthenticated.Login; | |
| this.views.signup = Maitsu.Views.Unauthenticated.Signup; | |
| this.views.retrievePassword = Maitsu.Views.Unauthenticated.RetrievePassword; | |
| this.tabContent.show(new this.views.login); | |
| }, | |
| switchViews: function(e) { | |
| e.preventDefault(); | |
| this.tabContent.show(new this.views[$(e.target).data('content')]); | |
| } | |
| }); | |
| Maitsu.addInitializer(function() { | |
| Maitsu.layouts.unauthenticated = new Maitsu.Views.Layouts.Unauthenticated(); | |
| }); |
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
| Maitsu = new Backbone.Marionette.Application(); | |
| Maitsu.Views = {}; | |
| Maitsu.Views.Layouts = {}; | |
| Maitsu.Models = {}; | |
| Maitsu.Collections = {}; | |
| Maitsu.Routers = {}; | |
| Maitsu.Helpers = {}; | |
| // Instantiated global layouts | |
| Maitsu.layouts = {}; | |
| Maitsu.addRegions({ | |
| main : '#main' | |
| }); | |
| Maitsu.vent.on("authentication:logged_in", function() { | |
| Maitsu.main.show(Maitsu.layouts.main); | |
| }); | |
| Maitsu.vent.on("authentication:logged_out", function() { | |
| Maitsu.main.show(Maitsu.layouts.unauthenticated); | |
| }); | |
| Maitsu.bind("start", function() { | |
| if(Maitsu.currentUser) { | |
| Maitsu.vent.trigger("authentication:logged_in"); | |
| } | |
| else { | |
| Maitsu.vent.trigger("authentication:logged_out"); | |
| } | |
| }); |
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
| // views/layouts/unauthenticated.js | |
| Maitsu.Views.Layouts.Unauthenticated = Backbone.Marionette.LayoutView.extend({ | |
| template: 'layouts/unauthenticated', | |
| regions: { | |
| tabContent: '#tab-content' | |
| }, | |
| views: {}, | |
| events: { | |
| 'click ul.nav-tabs li a' : 'switchViews' | |
| }, | |
| onShow: function() { | |
| this.views.login = Maitsu.Views.Unauthenticated.Login; | |
| this.views.signup = Maitsu.Views.Unauthenticated.Signup; | |
| this.views.retrievePassword = Maitsu.Views.Unauthenticated.RetrievePassword; | |
| this.tabContent.show(new this.views.login); | |
| }, | |
| switchViews: function(e) { | |
| e.preventDefault(); | |
| this.tabContent.show(new this.views[$(e.target).data('content')]); | |
| } | |
| }); | |
| Maitsu.addInitializer(function() { | |
| Maitsu.layouts.unauthenticated = new Maitsu.Views.Layouts.Unauthenticated(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment