fix image expansion bug
wtf did this come from?
This commit is contained in:
parent
4bb1b40126
commit
6cc89ab68d
11
4chan_x.js
11
4chan_x.js
@ -1993,13 +1993,14 @@
|
||||
},
|
||||
cb: {
|
||||
node: function(root) {
|
||||
var thumb, _i, _len, _ref2, _results;
|
||||
var a, thumb, _i, _len, _ref2, _results;
|
||||
_ref2 = $$('img[md5]', root);
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
|
||||
thumb = _ref2[_i];
|
||||
$.bind(thumb.parentNode, 'click', imgExpand.cb.toggle);
|
||||
_results.push(imgExpand.on ? imgExpand.toggle(thumb) : void 0);
|
||||
a = thumb.parentNode;
|
||||
$.bind(a, 'click', imgExpand.cb.toggle);
|
||||
_results.push(imgExpand.on ? imgExpand.toggle(a) : void 0);
|
||||
}
|
||||
return _results;
|
||||
},
|
||||
@ -2043,9 +2044,9 @@
|
||||
return _results;
|
||||
}
|
||||
},
|
||||
toggle: function(img) {
|
||||
toggle: function(a) {
|
||||
var thumb;
|
||||
thumb = img.parentNode.firstChild;
|
||||
thumb = a.firstChild;
|
||||
imgExpand.foo();
|
||||
if (thumb.style.display) {
|
||||
return imgExpand.contract(thumb);
|
||||
|
||||
@ -1539,8 +1539,9 @@ imgExpand =
|
||||
cb:
|
||||
node: (root) ->
|
||||
for thumb in $$ 'img[md5]', root
|
||||
$.bind thumb.parentNode, 'click', imgExpand.cb.toggle
|
||||
if imgExpand.on then imgExpand.toggle thumb
|
||||
a = thumb.parentNode
|
||||
$.bind a, 'click', imgExpand.cb.toggle
|
||||
if imgExpand.on then imgExpand.toggle a
|
||||
toggle: (e) ->
|
||||
return if e.shiftKey or e.altKey or e.ctrlKey or e.button isnt 0
|
||||
e.preventDefault()
|
||||
@ -1562,8 +1563,8 @@ imgExpand =
|
||||
for img in $$ 'img[md5] + img'
|
||||
imgExpand.resize img
|
||||
|
||||
toggle: (img) ->
|
||||
thumb = img.parentNode.firstChild
|
||||
toggle: (a) ->
|
||||
thumb = a.firstChild
|
||||
imgExpand.foo()
|
||||
if thumb.style.display
|
||||
imgExpand.contract thumb
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user