UX: Apply `no-text` to buttons without labels and content
This commit is contained in:
parent
c275a68daf
commit
e621e33321
|
@ -4,8 +4,14 @@ import { iconNode } from 'discourse/helpers/fa-icon';
|
|||
export default createWidget('button', {
|
||||
tagName: 'button.widget-button',
|
||||
|
||||
buildClasses() {
|
||||
if (this.attrs.className) { return this.attrs.className; }
|
||||
buildClasses(attrs) {
|
||||
const className = this.attrs.className || '';
|
||||
|
||||
if (!attrs.label && !attrs.contents) {
|
||||
return className + ' no-text';
|
||||
}
|
||||
|
||||
return className;
|
||||
},
|
||||
|
||||
buildAttributes() {
|
||||
|
|
|
@ -29,7 +29,7 @@ createWidget('topic-admin-menu-button', {
|
|||
|
||||
const result = [];
|
||||
result.push(this.attach('button', {
|
||||
className: 'btn no-text' + (attrs.fixed ? " show-topic-admin" : ""),
|
||||
className: 'btn ' + (attrs.fixed ? " show-topic-admin" : ""),
|
||||
title: 'topic_admin_menu',
|
||||
icon: 'wrench',
|
||||
action: 'showAdminMenu',
|
||||
|
|
|
@ -52,7 +52,7 @@ export default createWidget('topic-notifications-button', {
|
|||
if (this.attrs.showFullTitle) {
|
||||
button.label = `topic.notifications.${details.key}.title`;
|
||||
} else {
|
||||
button.className = 'btn no-text notifications-dropdown';
|
||||
button.className = 'btn notifications-dropdown';
|
||||
}
|
||||
|
||||
return this.attach('button', button);
|
||||
|
|
Loading…
Reference in New Issue