mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 23:06:57 +08:00
No need to default aria-label
to label.
This commit is contained in:
parent
08d68e846c
commit
8bc5da57b0
|
@ -6,7 +6,7 @@ export default Ember.Component.extend({
|
|||
|
||||
tagName: 'button',
|
||||
classNameBindings: [':btn', 'noText', 'btnType'],
|
||||
attributeBindings: ['disabled', 'translatedTitle:title', 'ariaLabel:aria-label', 'tabindex'],
|
||||
attributeBindings: ['disabled', 'translatedTitle:title', 'translatedTitle:aria-label', 'tabindex'],
|
||||
|
||||
btnIcon: Ember.computed.notEmpty('icon'),
|
||||
|
||||
|
@ -31,11 +31,6 @@ export default Ember.Component.extend({
|
|||
if (label) return I18n.t(label);
|
||||
},
|
||||
|
||||
@computed("translatedTitle", "translatedLabel")
|
||||
ariaLabel(translatedTitle, translatedLabel) {
|
||||
return translatedTitle ? translatedTitle : translatedLabel;
|
||||
},
|
||||
|
||||
click() {
|
||||
this.sendAction("action", this.get("actionParam"));
|
||||
return false;
|
||||
|
|
|
@ -28,18 +28,14 @@ export const ButtonClass = {
|
|||
|
||||
buildAttributes() {
|
||||
const attrs = this.attrs;
|
||||
const attributes = {};
|
||||
|
||||
let title;
|
||||
if (attrs.title) {
|
||||
title = I18n.t(attrs.title, attrs.titleOptions);
|
||||
const title = I18n.t(attrs.title, attrs.titleOptions);
|
||||
attributes["aria-label"] = title;
|
||||
attributes.title = title;
|
||||
}
|
||||
|
||||
let label;
|
||||
if (attrs.label) {
|
||||
label = I18n.t(attrs.label, attrs.labelOptions);
|
||||
}
|
||||
|
||||
const attributes = { "aria-label": label, title };
|
||||
if (attrs.disabled) { attributes.disabled = "true"; }
|
||||
|
||||
if (attrs.data) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user