Skip to content
Snippets Groups Projects
Commit 4a1aed56 authored by Jared Hancock's avatar Jared Hancock
Browse files

Provide delay on inline-image hover

This means that drive-by mouse hovers, where the user likely did not intend
for the hover to actually popup the banner with the filename and download
button, do not trigger the popup. This patch changes the popup effect so
that it requires a 500ms hover before the popup is shown.
parent cb25546b
No related branches found
No related tags found
No related merge requests found
......@@ -428,10 +428,18 @@ showImagesInline = function(urls, thread_id) {
e = $(el);
if (info) {
// Add a hover effect with the filename
var caption = $('<div class="image-hover">')
var timeout, caption = $('<div class="image-hover">')
.hover(
function() { $(this).find('.caption').slideDown(250); },
function() { $(this).find('.caption').slideUp(250); }
function() {
var self = this;
timeout = setTimeout(
function() { $(self).find('.caption').slideDown(250); },
500);
},
function() {
clearTimeout(timeout);
$(this).find('.caption').slideUp(250);
}
).append($('<div class="caption">')
.append('<span class="filename">'+info.filename+'</span>')
.append('<a href="'+info.download_url+'" class="action-button"><i class="icon-download-alt"></i> Download</a>')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment