Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

Commit

Permalink
prettier no posts message
Browse files Browse the repository at this point in the history
  • Loading branch information
danecando committed Aug 6, 2014
1 parent 2953c53 commit 055e45c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions jquery.ghostrelated.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,29 @@
url: this.options.feed,
type: 'GET'
})
.done(function(data) {
.done(function(data) {

// Success fetching feed, find related posts and output them
var posts = that.getPosts(data);
var related = that.matchByTag(that._currentPostTags, posts);
// Success fetching feed, find related posts and output them
var posts = that.getPosts(data);
var related = that.matchByTag(that._currentPostTags, posts);

var count = 0;
related.forEach(function(post) {
if (count < that.options.limit) {
$(that.element).append($('<li><a href="' + post.url + '">' + post.title + '</a></li>'));
}
count++;
});

if (count == 0) {
$(that.element).append($('<p>No related posts were found. ' +
'Check the <a href="/">index</a>.</p>'));
var count = 0;
related.forEach(function(post) {
if (count < that.options.limit) {
$(that.element).append($('<li><a href="' + post.url + '">' + post.title + '</a></li>'));
}
})
.fail(function(e) {
that.reportError(e);
count++;
});

if (count == 0) {
$(that.element).append($('<p>No related posts were found. ' +
'Check the <a href="/">index</a>.</p>'));
}
})
.fail(function(e) {
that.reportError(e);
});

};


Expand Down
2 changes: 1 addition & 1 deletion jquery.ghostrelated.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 055e45c

Please sign in to comment.