Shave a line/selector. Chrome bug comment.

This commit is contained in:
Nicolas Stepien 2011-07-20 20:56:52 +02:00
parent eeeecc7d93
commit abd4aea3c1
2 changed files with 17 additions and 14 deletions

View File

@ -2449,11 +2449,10 @@
}; };
imageHover = { imageHover = {
init: function() { init: function() {
var img; imageHover.img = $.el('img', {
img = $.el('img', {
id: 'iHover' id: 'iHover'
}); });
$.append(d.body, img); $.append(d.body, imageHover.img);
return g.callbacks.push(imageHover.node); return g.callbacks.push(imageHover.node);
}, },
node: function(root) { node: function(root) {
@ -2466,11 +2465,12 @@
return $.bind(thumb, 'mouseout', ui.hoverend); return $.bind(thumb, 'mouseout', ui.hoverend);
}, },
mouseover: function(e) { mouseover: function(e) {
var el; /*
el = $('#iHover'); img.src = null doesn't work on Chrome
el.src = null; http://code.google.com/p/chromium/issues/detail?id=36142
el.src = this.parentNode.href; */ imageHover.img.src = null;
return ui.el = el; imageHover.img.src = this.parentNode.href;
return ui.el = imageHover.img;
} }
}; };
imgPreloading = { imgPreloading = {

View File

@ -1850,8 +1850,8 @@ nodeInserted = (e) ->
imageHover = imageHover =
init: -> init: ->
img = $.el 'img', id: 'iHover' imageHover.img = $.el 'img', id: 'iHover'
$.append d.body, img $.append d.body, imageHover.img
g.callbacks.push imageHover.node g.callbacks.push imageHover.node
node: (root) -> node: (root) ->
return unless thumb = $ 'img[md5]', root return unless thumb = $ 'img[md5]', root
@ -1859,10 +1859,13 @@ imageHover =
$.bind thumb, 'mousemove', ui.hover $.bind thumb, 'mousemove', ui.hover
$.bind thumb, 'mouseout', ui.hoverend $.bind thumb, 'mouseout', ui.hoverend
mouseover: (e) -> mouseover: (e) ->
el = $ '#iHover' ###
el.src = null img.src = null doesn't work on Chrome
el.src = @parentNode.href http://code.google.com/p/chromium/issues/detail?id=36142
ui.el = el ###
imageHover.img.src = null
imageHover.img.src = @parentNode.href
ui.el = imageHover.img
imgPreloading = imgPreloading =
init: -> init: ->