UX: Apply `no-text` to buttons without labels and content

This commit is contained in:
Robin Ward 2016-06-08 11:14:36 -04:00
parent c275a68daf
commit e621e33321
3 changed files with 10 additions and 4 deletions

View File

@ -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() {

View File

@ -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',

View File

@ -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);