Permalink
Browse files

Clarified getComments

  • Loading branch information...
1 parent 2e48237 commit b033f96894c5d8d0fc11774ad193cf94b7feaf18 @fb55 fb55 committed Sep 17, 2011
Showing with 6 additions and 10 deletions.
  1. +6 −10 lib/nodepie.js
View
@@ -927,18 +927,14 @@ NodePie.Item.prototype.getComments = function(){
var wfwns = this.feed.namespaces[NodePie.NS.WFW],
html, feed;
- if(this.element.comments){
- html = this.element.comments;
- }else{
+ if( !(html = this.element.comments) )
html = this.getLink("replies", "text/html");
- }
- if(wfwns && this.element[wfwns+":commentRss"]){
- feed = this.element[wfwns+":commentRss"];
- }else{
- feed = this.getLink("replies", "application/atom+xml");
- }
+ feed = wfwns && (feed = this.element[wfwns+":commentRss"]);
+
+ if(!feed)
+ feed = this.getLink("replies", "application/atom+xml");
- return feed || html ? {feed: feed, html: html} : false;
+ return (feed || html) ? {feed: feed, html: html} : false;
};

0 comments on commit b033f96

Please sign in to comment.