fix image expansion bug

wtf did this come from?
This commit is contained in:
James Campos 2011-05-07 23:30:27 -07:00
parent 4bb1b40126
commit 6cc89ab68d
2 changed files with 11 additions and 9 deletions

View File

@ -1993,13 +1993,14 @@
}, },
cb: { cb: {
node: function(root) { node: function(root) {
var thumb, _i, _len, _ref2, _results; var a, thumb, _i, _len, _ref2, _results;
_ref2 = $$('img[md5]', root); _ref2 = $$('img[md5]', root);
_results = []; _results = [];
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
thumb = _ref2[_i]; thumb = _ref2[_i];
$.bind(thumb.parentNode, 'click', imgExpand.cb.toggle); a = thumb.parentNode;
_results.push(imgExpand.on ? imgExpand.toggle(thumb) : void 0); $.bind(a, 'click', imgExpand.cb.toggle);
_results.push(imgExpand.on ? imgExpand.toggle(a) : void 0);
} }
return _results; return _results;
}, },
@ -2043,9 +2044,9 @@
return _results; return _results;
} }
}, },
toggle: function(img) { toggle: function(a) {
var thumb; var thumb;
thumb = img.parentNode.firstChild; thumb = a.firstChild;
imgExpand.foo(); imgExpand.foo();
if (thumb.style.display) { if (thumb.style.display) {
return imgExpand.contract(thumb); return imgExpand.contract(thumb);

View File

@ -1539,8 +1539,9 @@ imgExpand =
cb: cb:
node: (root) -> node: (root) ->
for thumb in $$ 'img[md5]', root for thumb in $$ 'img[md5]', root
$.bind thumb.parentNode, 'click', imgExpand.cb.toggle a = thumb.parentNode
if imgExpand.on then imgExpand.toggle thumb $.bind a, 'click', imgExpand.cb.toggle
if imgExpand.on then imgExpand.toggle a
toggle: (e) -> toggle: (e) ->
return if e.shiftKey or e.altKey or e.ctrlKey or e.button isnt 0 return if e.shiftKey or e.altKey or e.ctrlKey or e.button isnt 0
e.preventDefault() e.preventDefault()
@ -1562,8 +1563,8 @@ imgExpand =
for img in $$ 'img[md5] + img' for img in $$ 'img[md5] + img'
imgExpand.resize img imgExpand.resize img
toggle: (img) -> toggle: (a) ->
thumb = img.parentNode.firstChild thumb = a.firstChild
imgExpand.foo() imgExpand.foo()
if thumb.style.display if thumb.style.display
imgExpand.contract thumb imgExpand.contract thumb