accessibility support for CheckBox
This commit is contained in:
parent
74e3c0908b
commit
1a982809f6
@ -36,11 +36,22 @@ function CheckBox(parentElement)
|
||||
|
||||
var child = document.createElement("div");
|
||||
child.className = "uwt-checkbox";
|
||||
child.tabIndex = 0;
|
||||
child.NativeObject = this;
|
||||
child.addEventListener("click", function(e)
|
||||
{
|
||||
this.NativeObject.ToggleChecked();
|
||||
});
|
||||
child.addEventListener("keydown", function(e)
|
||||
{
|
||||
if (e.keyCode === KeyboardKeys.Space)
|
||||
{
|
||||
this.NativeObject.ToggleChecked();
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
var fa = document.createElement("i");
|
||||
fa.className = "fa fa-check";
|
||||
child.appendChild(fa);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user