UX: Convert bookmark icon from CSS to a proper icon using our helper

This commit is contained in:
Robin Ward 2017-09-07 11:41:19 -04:00
parent 0ba789de17
commit afc075d93b
2 changed files with 11 additions and 25 deletions

View File

@ -173,20 +173,18 @@ registerButton('reply', attrs => {
registerButton('bookmark', attrs => {
if (!attrs.canBookmark) { return; }
let iconClass = 'read-icon';
let buttonClass = 'bookmark';
let tooltip = 'bookmarks.not_bookmarked';
let className = 'bookmark';
if (attrs.bookmarked) {
iconClass += ' bookmarked';
buttonClass += ' bookmarked';
tooltip = 'bookmarks.created';
className += ' bookmarked';
}
return { action: 'toggleBookmark',
title: tooltip,
className: buttonClass,
contents: h('div', { className: iconClass }) };
return {
action: 'toggleBookmark',
title: attrs.bookmarked ? "bookmarks.created" : "bookmarks.not_bookmarked",
className,
icon: 'bookmark'
};
});
registerButton('admin', attrs => {

View File

@ -161,22 +161,10 @@ nav.post-controls {
box-shadow: none;
}
&.bookmark {padding: 8px 11px; }
.read-icon {
&:before {
font-family: "FontAwesome";
content: "\f02e";
}
&.unseen {
&:before {
content: "\f097";
}
}
&.bookmark {
padding: 8px 11px;
&.bookmarked {
&:before {
color: $tertiary;
}
color: $tertiary;
}
}
}