$('.thumbnail').on('mouseover', ns.add_enlarged_thumbnail);
};
+ ns.download = function(e) {
+ var file_id = $(e.target).data('file-id');
+ var file_version = $(e.target).data('file-version');
+
+ var data = {
+ action: 'File/download',
+ id: file_id,
+ version: file_version,
+ };
+
+ $.post("controller.pl", data, kivi.eval_json_result);
+
+ };
+
ns.init = function() {
// Preventing page from redirecting
$("#" + ns.list_div_id).on("dragover", function(e) {
});
$('.thumbnail').on('mouseover', ns.add_enlarged_thumbnail);
- $('.overlay_img').on('click', ns.remove_enlarged_thumbnail);
$('.overlay_img').on('mouseout', ns.remove_enlarged_thumbnail);
+ $('.overlay_div img').on('click', ns.download);
};
});
data-file-id="[% file.id %]" data-file-version="[% file.version %]"
src="data:[% HTML.escape(file.thumbnail.thumbnail_img_content_type) %];base64,[% file.thumbnail.thumbnail_img_content.encode_base64 %]"
alt="[% file.file_name %]">
- <img id="enlarged_thumb_[% file.id %][% IF file.version %]_[% file.version %][% END %]" class="overlay_img" style="display:none;">
+ <img id="enlarged_thumb_[% file.id %][% IF file.version %]_[% file.version %][% END %]" class="overlay_img" style="display:none;"
+ data-file-id="[% file.id %]" data-file-version="[% file.version %]">
</div>
[%- ELSE %]
-