fix accessibility for 'New' file inputs

This commit is contained in:
Jan-Christoph Borchardt 2014-12-18 15:52:42 +01:00
parent 7e5fbde4cd
commit 137d19f6b1
1 changed files with 6 additions and 1 deletions

View File

@ -574,10 +574,15 @@ OC.Upload = {
var form = $('<form></form>');
var input = $('<input type="text">');
var newName = $(this).attr('data-newname') || '';
var fileType = 'input-' + $(this).attr('data-type');
if (newName) {
input.val(newName);
input.attr('id', fileType);
}
form.append(input);
var label = $('<label class="hidden-visually" for="">' + newName + '</label>');
label.attr('for', fileType);
form.append(label).append(input);
$(this).append(form);
var lastPos;
var checkInput = function () {