namespace view, model, and collection under App

This commit is contained in:
Daniel Grippi 2011-12-03 11:42:48 -08:00 committed by Dennis Collinson
parent dca3581ae2
commit d4219799e4
3 changed files with 6 additions and 6 deletions

View file

@ -1,4 +1,4 @@
var BackboneStream = Backbone.Collection.extend({
App.Collections.Stream = Backbone.Collection.extend({
url: function() {
var path = document.location.pathname;
@ -10,7 +10,7 @@ var BackboneStream = Backbone.Collection.extend({
}
},
model: Post,
model: App.Models.Post,
parse: function(resp){
return resp.posts;

View file

@ -1,4 +1,4 @@
var Post = Backbone.Model.extend({
App.Models.Post = Backbone.Model.extend({
url: "/posts/:id",
intTime: function(){
return +new Date(this.get("created_at")) / 1000;

View file

@ -1,5 +1,5 @@
$(function() {
window.StreamView = Backbone.View.extend({
App.Views.Stream = Backbone.View.extend({
el: $("#main_stream"),
@ -12,7 +12,7 @@ $(function() {
initialize: function(){
_.bindAll(this, "appendPost", "collectionFetched");
this.collection = new window.BackboneStream;
this.collection = new App.Collections.Stream;
this.collection.bind("add", this.appendPost);
this.loadMore();
},
@ -50,6 +50,6 @@ $(function() {
});
if(window.useBackbone) {
window.stream = new window.StreamView;
window.stream = new App.Views.Stream;
}
});