зеркало из https://github.com/mozilla/CSOL-site.git
Fixing upload form accessibility
This commit is contained in:
Родитель
d8126ed360
Коммит
8e99417e4e
|
@ -72,7 +72,7 @@
|
||||||
$template = $(options.template),
|
$template = $(options.template),
|
||||||
$buttons = $(options.buttonContainer),
|
$buttons = $(options.buttonContainer),
|
||||||
$description = $(document.createElement('div')),
|
$description = $(document.createElement('div')),
|
||||||
$label = $(document.createElement('label')),
|
$btn = $(document.createElement('span')),
|
||||||
itemSelector = '.' + $template[0].className.replace(/\s+/g, '.'),
|
itemSelector = '.' + $template[0].className.replace(/\s+/g, '.'),
|
||||||
itemCount = 0,
|
itemCount = 0,
|
||||||
xhr = (window.XMLHttpRequest && new XMLHttpRequest()) || {};
|
xhr = (window.XMLHttpRequest && new XMLHttpRequest()) || {};
|
||||||
|
@ -81,16 +81,20 @@
|
||||||
|
|
||||||
$template.remove();
|
$template.remove();
|
||||||
|
|
||||||
|
$template.find('input[type="file"]').attr('tabIndex', -1);
|
||||||
|
|
||||||
$description
|
$description
|
||||||
.addClass('description')
|
.addClass('description')
|
||||||
.html('<span><strong>Drop photos and videos here</strong> <em>or</em></span>')
|
.html('<span><strong>Drop photos and videos here</strong> <em>or</em></span>')
|
||||||
.prependTo($template);
|
.prependTo($template);
|
||||||
|
|
||||||
$label
|
$btn
|
||||||
.addClass('btn')
|
.addClass('btn')
|
||||||
.text('Choose photos and videos to upload')
|
.text('Choose photos and videos to upload')
|
||||||
.appendTo($description)
|
.appendTo($description)
|
||||||
.click(function() { $(this).parents('.item').find('input').click(); });
|
.attr('tabIndex', 0)
|
||||||
|
.click(function() { $(this).parents('.item').find('input').click(); })
|
||||||
|
.keypress(function() { $(this).click(); });
|
||||||
|
|
||||||
if (xhr.upload && window.FormData) {
|
if (xhr.upload && window.FormData) {
|
||||||
goAsync();
|
goAsync();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче