Created
September 6, 2012 20:42
-
-
Save shinecita/3660225 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
var OrganizationRouter = module.exports = Backbone.Router.extend({ | |
routes: { | |
'o/:organizationName': 'show' | |
, 'createOrganization': 'add' | |
} | |
, show: function (orgUserName) { | |
$('body').removeClass(); | |
$('body').addClass('organizations'); | |
// var org = new Organization({id : orgUserName}); | |
// org.fetch({success: function(){ | |
// var view = new OrganizationView({model: org}); | |
// Application. | |
// trigger('showSidebar', view); | |
// } | |
// }); | |
console.log("Application.organizations", Application.organizations); | |
Application.organizations.findOrFetch(orgUserName, function(err, model) { | |
var view = new OrganizationView({model: model}); | |
Application. | |
trigger('showSidebar', view); | |
}); | |
} | |
, add: function(){ | |
console.log("Adding Organization"); | |
var view = new AddOrganizationView(); | |
Application. | |
trigger('showSidebar', view); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment