summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--static/js/pichat.js12
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);
});