forked from SimonEast/file-uploader
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to give input element an 'aria-labelledby' attribute with …
…the value of the parent div's 'input-labeled-by' attribute. For WCAG compliance.
- Loading branch information
Leslie Baker
committed
Oct 9, 2014
1 parent
2b3b2d6
commit a3180c3
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -333,7 +333,8 @@ qq.FileUploaderBasic.prototype = { | |
acceptFiles: this._options.acceptFiles, | ||
onChange: function(input){ | ||
self._onInputChange(input); | ||
} | ||
}, | ||
inputLabeledBy: $(this._options.element).attr('input-labeled-by') | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ebrentnelson
|
||
}); | ||
|
||
this.addDisposer(function() { button.dispose(); }); | ||
|
@@ -938,6 +939,10 @@ qq.UploadButton.prototype = { | |
input.setAttribute("type", "file"); | ||
input.setAttribute("name", this._options.name); | ||
|
||
if (this._options["inputLabeledBy"]) { | ||
input.setAttribute("aria-labelledby", this._options["inputLabeledBy"]); | ||
} | ||
|
||
qq.css(input, { | ||
position: 'absolute', | ||
// in Opera only 'browse' button | ||
|
1 comment
on commit a3180c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there, I think it would be better to use another method of getting the element, since in the README it says this lib doesn't require jQuery =)