X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/5120c3d4010a473652c96277789680e9da2edfd0..e32eab0deee844e3df8dfdfd784da674260c2351:/src/editor/views/attachments/attachments.js diff --git a/src/editor/views/attachments/attachments.js b/src/editor/views/attachments/attachments.js index 45366ff..31d8095 100644 --- a/src/editor/views/attachments/attachments.js +++ b/src/editor/views/attachments/attachments.js @@ -28,17 +28,21 @@ var attachmentLibrary = function(callback, params) { dataType: 'json', success: function(data, status, jqxhr) { for (var i in data) { - var img = $("") + var img = $(""); + var input = $(""); + var label = $(""); var div = $("
"); - div.append(img); - div.append(data[i]['name']) + label.append(input); + label.append(img); + label.append(data[i]['name']); img.attr("src", data[i]['thumbnail_url']); img.attr("title", data[i]['name']); + input.attr('id', 'attachment' + i); + label.attr('for', 'attachment' + i); + div.append(label); div.attr("data-output", 'file://' + data[i]['name']); div.on('click', function() { - $("div", body).attr('style', 'border: 1px solid white'); - $("div", body).removeClass('active'); - $(this).attr('style', 'border: 1px solid black'); + $("div.active", body).removeClass('active'); $(this).addClass('active'); }); body.append(div);