UX: Allow for customization of the heart icon

This commit is contained in:
Robin Ward 2017-10-04 11:07:59 -04:00
parent 1310181664
commit abdb334823
2 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,8 @@ const REPLACEMENTS = {
'd-watching-first': 'dot-circle-o',
'd-drop-expanded': 'caret-down',
'd-drop-collapsed': 'caret-right',
'd-unliked': 'heart',
'd-liked': 'heart',
'notification.mentioned': "at",
'notification.group_mentioned': "at",
'notification.quoted': "quote-right",

View File

@ -35,10 +35,11 @@ registerButton('like', attrs => {
const button = {
action: 'like',
icon: 'heart',
icon: attrs.liked ? 'd-liked' : 'd-unliked',
className
};
if (attrs.canToggleLike) {
button.title = attrs.liked ? 'post.controls.undo_like' : 'post.controls.like';
} else if (attrs.liked) {
@ -368,7 +369,7 @@ export default createWidget('post-menu', {
return this.sendWidgetAction('toggleLike');
}
const $heart = $(`[data-post-id=${attrs.id}] .d-icon-heart`);
const $heart = $(`[data-post-id=${attrs.id}] .toggle-like .d-icon`);
$heart.closest('button').addClass('has-like');
if (!Ember.testing) {