fix arrow direction in post incoming links

This commit is contained in:
Régis Hanol 2013-10-23 11:16:03 +02:00
parent a12a1bcc66
commit d05547e7f3

View File

@ -8,23 +8,17 @@
**/
Discourse.PostLinkView = Discourse.View.extend({
tagName: 'li',
classNameBindings: ['direction'],
direction: function() {
if (this.get('content.reflection')) return 'incoming';
return null;
}.property('content.reflection'),
direction: function() { return this.get('content.reflection') ? "left" : "right"; },
render: function(buffer) {
var clicks;
buffer.push("<a href='" + (this.get('content.url')) + "' class='track-link'>\n");
buffer.push("<i class='icon icon-arrow-right'></i>");
buffer.push("<a href='" + this.get('content.url') + "' class='track-link'>");
buffer.push("<i class='icon icon-arrow-'" + this.direction() + "></i>");
buffer.push(this.get('content.title'));
if (clicks = this.get('content.clicks')) {
buffer.push("\n<span class='badge badge-notification clicks'>" + clicks + "</span>");
buffer.push("<span class='badge badge-notification clicks'>" + clicks + "</span>");
}
return buffer.push("</a>");
buffer.push("</a>");
}
});