diff options
author | Sarven Capadisli <csarven@controlyourself.ca> | 2009-05-28 23:16:25 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@controlyourself.ca> | 2009-05-28 23:16:25 +0000 |
commit | 6612993c1d59051bbb4dafed73e0111eec8ccfd6 (patch) | |
tree | 4d0d8cc18e257153f4348f3ac27d287d4e9928a7 /js/util.js | |
parent | f0dc97e4da16181b0d6a74361734678d0f37fd5e (diff) |
Prevents regular hovers over attachment anchors from making a GET
request for the thumbnail. There is 500 ms delay while on mouseover
state before going ahead with the request. Fun.
Diffstat (limited to 'js/util.js')
-rw-r--r-- | js/util.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/js/util.js b/js/util.js index 6cfad3a8e..d5697e880 100644 --- a/js/util.js +++ b/js/util.js @@ -276,6 +276,8 @@ function NoticeAttachments() { $().jOverlay({url: $('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; }); + + var t; $("body:not(#shownotice) a.thumbnail").hover( function() { var anchor = $(this); @@ -283,7 +285,7 @@ function NoticeAttachments() { anchor.closest(".entry-title").addClass('ov'); if (anchor.children('img').length == 0) { - setTimeout(function() { + t = setTimeout(function() { $.get($('address .url')[0].href+'/attachment/' + (anchor.attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) { anchor.append(data); }); @@ -294,6 +296,7 @@ function NoticeAttachments() { } }, function() { + clearTimeout(t); $("a.thumbnail").children('img').hide(); $(this).closest(".entry-title").removeClass('ov'); } |