diff options
| author | Scott Ostler <scottbot9000@gmail.com> | 2010-06-21 01:53:37 -0400 |
|---|---|---|
| committer | Scott Ostler <scottbot9000@gmail.com> | 2010-06-21 01:53:37 -0400 |
| commit | d9bf4e9e0580a92c408d24c324a62b8ba6f32f4f (patch) | |
| tree | 1374c0ddcc871cd2f77c58c3897ac60c7b0311ed /static | |
| parent | 41fe6fffb32dbef23f39e844bf36eb0ba6c49c90 (diff) | |
don't show zoom for smaller than 200x200 images
Diffstat (limited to 'static')
| -rw-r--r-- | static/js/pichat.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/static/js/pichat.js b/static/js/pichat.js index 2a994b0..5a7f956 100644 --- a/static/js/pichat.js +++ b/static/js/pichat.js @@ -1038,6 +1038,8 @@ $(function() { OrigTitle = $('title').text(); }); +var imgZoomThreshhold = [200, 200]; + function initChatMsgs() { $('.msgDiv .content').live('mouseenter', function(e) { $(this).addClass('msg-hover'); @@ -1048,13 +1050,17 @@ function initChatMsgs() { }); $('.msgDiv .content .img-wrapper').live('mouseenter', function(e) { - var imgurl = $(this).find('img').attr('src'); + var img = $(this).find('img'); + + if (img.width() < imgZoomThreshhold[0] || img.height() < imgZoomThreshhold[1]) + return; + var zoomlink = $('<a>') - .attr({'href': imgurl }) + .attr({'href': img.attr('src') }) .addClass('msg-image-zoom') .append($('<img>').attr('src', 'http://dump.fm/static/img/zoom.gif') .addClass('zoom-icon')) - .click(function() { window.open(imgurl); return false; }); + .click(function() { window.open(img.attr('src')); return false; }); $(this).append(zoomlink); }); |
