Created
February 22, 2012 22:19
-
-
Save rissajeanne/1887854 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.View.PassagePanelBrowse = Backbone.View.extend({ | |
initialize : function() { | |
var that = this; | |
_.bindAll(this, 'render'); | |
this.bind('passage:change', this.render); | |
}, | |
render : function(options) { | |
var that = this; | |
$(this.el).append(ABS.jst.PassageBrowseDropdown()); | |
if (options) { | |
this.bookList = ABS.spi.allVersions.get(options.get('version').id).books; | |
if (this.bookList.length == 0) { | |
this.bookList.fetch(); | |
} | |
this._bookListView = new ABS.View.BookList({ | |
collection : this.bookList, | |
el : that.$('.books ul') | |
}).render(); | |
this.chapterList = new ABS.Model.Book(options.get('book')).chapters; | |
if (this.chapterList.length == 0) { | |
this.chapterList.fetch(); | |
} | |
this._chapterListView = new ABS.View.ChapterList({ | |
collection : this.chapterList, | |
el : that.$('.chapters ul') | |
}).render(); | |
} | |
return this; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment