FEATURE: add op-bookmark class for op-bookmarks

This commit is contained in:
Sam 2015-05-05 10:23:17 +10:00
parent b4f666630e
commit 8e372f3616
2 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@
{{/if ~}}
{{~#each status in view.statuses ~}}
{{~#if status.href ~}}
<a href='{{status.href}}' title='{{status.title}}' class='topic-status'><i class='fa fa-{{status.icon}}'></i></a>
<a href='{{status.href}}' title='{{status.title}}' class='topic-status {{status.extraClasses}}'><i class='fa fa-{{status.icon}}'></i></a>
{{~else ~}}
<{{status.openTag}} title='{{status.title}}' class='topic-status'><i class='fa fa-{{status.icon}}'></i></{{status.closeTag}}>
{{~/if ~}}

View File

@ -16,10 +16,14 @@ export default Ember.Object.extend({
if(topic.get('bookmarked')){
var url = topic.get('url');
var postNumbers = topic.get('bookmarked_post_numbers');
var extraClasses = "";
if(postNumbers && postNumbers[0] > 1) {
url += '/' + postNumbers[0];
} else {
extraClasses = "op-bookmark";
}
results.push({icon: 'bookmark', key: 'bookmarked', href: url});
results.push({extraClasses: extraClasses, icon: 'bookmark', key: 'bookmarked', href: url});
}
if(topic.get('closed')){