Created
February 21, 2012 18:03
-
-
Save rissajeanne/1877876 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
ABS.Model.PassagePanel = Backbone.Model.extend({ | |
initialize: function () { | |
this.updateBooks(); | |
}, | |
updateBooks: function () { | |
var that = this, | |
versions = new ABS.Collection.VersionList(ABS.bootstrap.versions), | |
getBookOrd = function (book) { return book.get('ord'); }; | |
var version = versions.get(this.id); | |
version.books.fetch({ | |
success: function (books) { | |
var attributes = {}; | |
_.each(books.models, function (book) { | |
book.chapters.fetch(); | |
}); | |
attributes.books = books.models; | |
that.set(attributes); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment