mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
UX: Allow for customization of the heart icon
This commit is contained in:
parent
1310181664
commit
abdb334823
@ -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",
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user