FEATURE: add aria-label for accessibility

This commit is contained in:
Sam 2015-05-06 15:33:50 +10:00
parent bbd5452b8d
commit 46aa7dab80
1 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,9 @@ function animateHeart($elem, start, end, complete) {
Button.prototype.render = function(buffer) {
var opts = this.opts;
buffer.push("<button title=\"" + I18n.t(this.label) + "\"");
var label = I18n.t(this.label);
buffer.push("<button aria-label=\"" + label +"\" " + "title=\"" + label + "\"");
if (opts.disabled) { buffer.push(" disabled"); }
if (opts.className) { buffer.push(" class=\"" + opts.className + "\""); }
if (opts.shareUrl) { buffer.push(" data-share-url=\"" + opts.shareUrl + "\""); }