X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/7b7f19b8680ed7653359bede5833d2cffc11ef8c..a49547b7a4bef633bb92bee9cf97fdcfe67c76aa:/src/editor/views/attachments/attachments.js?ds=sidebyside diff --git a/src/editor/views/attachments/attachments.js b/src/editor/views/attachments/attachments.js index 258a143..31d8095 100644 --- a/src/editor/views/attachments/attachments.js +++ b/src/editor/views/attachments/attachments.js @@ -28,22 +28,26 @@ 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); } - var editlink = $("Manage attachments"); + var editlink = $("" + gettext("Manage attachments") + ""); editlink.attr('href', config.documentGalleryUrl); body.append(editlink); },