First pass at accessibility improvements for #650

This commit is contained in:
Jermolene
2014-06-14 18:06:56 +01:00
parent b4ddaccd1d
commit eeedcb6d94
13 changed files with 40 additions and 11 deletions

View File

@@ -46,10 +46,16 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
}
}
domNode.className = classes.join(" ");
// Assign classes
// Assign other attributes
if(this.style) {
domNode.setAttribute("style",this.style);
}
if(this.title) {
domNode.setAttribute("title",this.title);
}
if(this["aria-label"]) {
domNode.setAttribute("aria-label",this["aria-label"]);
}
// Add a click event handler
domNode.addEventListener("click",function (event) {
var handled = false;
@@ -134,6 +140,8 @@ ButtonWidget.prototype.execute = function() {
this.popup = this.getAttribute("popup");
this.hover = this.getAttribute("hover");
this["class"] = this.getAttribute("class","");
this["aria-label"] = this.getAttribute("aria-label");
this.title = this.getAttribute("title");
this.style = this.getAttribute("style");
this.selectedClass = this.getAttribute("selectedClass");
this.defaultSetValue = this.getAttribute("default");