Merge pull request #918 from gotdibbs/Issue877

Fix a couple of issues when there are no posts
This commit is contained in:
Hannah Wolfe 2013-10-03 07:40:11 -07:00
commit 4bc8db57cc

View File

@ -35,6 +35,11 @@
showNext: function () {
if (this.isLoading) { return; }
if (!this.collection.length) {
return Backbone.trigger('blog:activeItem', null);
}
var id = this.collection.at(0).id;
if (id) {
Backbone.trigger('blog:activeItem', id);
@ -192,10 +197,9 @@
templateName: "preview",
render: function () {
if (this.activeId) {
this.model = this.collection.get(this.activeId);
this.$el.html(this.template(this.templateData()));
}
this.model = this.collection.get(this.activeId);
this.$el.html(this.template(this.templateData()));
this.$('.content-preview-content').scrollClass({target: '.content-preview', offset: 10});
this.$('.wrapper').on('click', 'a', function (e) {
$(e.currentTarget).attr('target', '_blank');