Revision 7de440bf
Von Bernd Bleßmann vor mehr als 3 Jahren hinzugefügt
js/kivi.File.js | ||
---|---|---|
301 | 301 |
return false; |
302 | 302 |
} |
303 | 303 |
|
304 |
ns.add_enlarged_thumbnail = function(e) { |
|
305 |
var file_id = $(e.target).data('file-id'); |
|
306 |
var overlay_img_id = 'enlarged_thumb_' + file_id; |
|
307 |
var overlay_img = $('#' + overlay_img_id); |
|
308 |
|
|
309 |
if (overlay_img.data('is-overlay-shown') == 1) return; |
|
310 |
|
|
311 |
$('.thumbnail').off('mouseover'); |
|
312 |
overlay_img.data('is-overlay-shown', 1); |
|
313 |
overlay_img.show(); |
|
314 |
|
|
315 |
if (overlay_img.data('is-overlay-loaded') == 1) return; |
|
316 |
|
|
317 |
var data = { |
|
318 |
action: 'File/ajax_get_thumbnail', |
|
319 |
file_id: file_id, |
|
320 |
file_version: $(e.target).data('file-version'), |
|
321 |
size: 512 |
|
322 |
}; |
|
323 |
|
|
324 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
325 |
}; |
|
326 |
|
|
327 |
ns.remove_enlarged_thumbnail = function(e) { |
|
328 |
$(e.target).hide(); |
|
329 |
$(e.target).data('is-overlay-shown', 0); |
|
330 |
$('.thumbnail').on('mouseover', ns.add_enlarged_thumbnail); |
|
331 |
}; |
|
332 |
|
|
304 | 333 |
ns.init = function() { |
305 | 334 |
// Preventing page from redirecting |
306 | 335 |
$("#" + ns.list_div_id).on("dragover", function(e) { |
... | ... | |
341 | 370 |
ns.upload_files(object_id, object_type, file_type, maxsize, is_global, files); |
342 | 371 |
}); |
343 | 372 |
|
373 |
$('.thumbnail').on('mouseover', ns.add_enlarged_thumbnail); |
|
374 |
$('.overlay_img').on('click', ns.remove_enlarged_thumbnail); |
|
375 |
$('.overlay_img').on('mouseout', ns.remove_enlarged_thumbnail); |
|
344 | 376 |
}; |
345 | 377 |
|
346 | 378 |
}); |
Auch abrufbar als: Unified diff
Dateimanagement: größere Vorschaubilder beim Drüberfahren