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