no iHover container div

This commit is contained in:
James Campos 2011-07-20 14:24:21 -07:00
parent a064101244
commit db856d775b
2 changed files with 25 additions and 28 deletions

View File

@ -2445,20 +2445,15 @@
}; };
imgHover = { imgHover = {
init: function() { init: function() {
imgHover.el = $.el('div', { return g.callbacks.push(function(root) {
id: 'iHover' var thumb;
if (!(thumb = $('img[md5]', root))) {
return;
}
$.bind(thumb, 'mouseover', imgHover.mouseover);
$.bind(thumb, 'mousemove', ui.hover);
return $.bind(thumb, 'mouseout', imgHover.mouseout);
}); });
$.append(d.body, imgHover.el);
return g.callbacks.push(imgHover.node);
},
node: function(root) {
var thumb;
if (!(thumb = $('img[md5]', root))) {
return;
}
$.bind(thumb, 'mouseover', imgHover.mouseover);
$.bind(thumb, 'mousemove', ui.hover);
return $.bind(thumb, 'mouseout', imgHover.mouseout);
}, },
mouseover: function(e) { mouseover: function(e) {
/* /*
@ -2468,13 +2463,15 @@
instead of manipulating src, we manipulate the entire img instead of manipulating src, we manipulate the entire img
*/ var img; */ var img;
img = $.el('img', { img = $.el('img', {
id: 'iHover',
src: this.parentNode.href src: this.parentNode.href
}); });
$.append(imgHover.el, img); imgHover.img = img;
return ui.el = imgHover.el; ui.el = img;
return $.append(d.body, img);
}, },
mouseout: function(e) { mouseout: function(e) {
return $.rm(imgHover.el.firstChild); return $.rm(imgHover.img);
} }
}; };
imgPreloading = { imgPreloading = {

View File

@ -1847,14 +1847,11 @@ nodeInserted = (e) ->
imgHover = imgHover =
init: -> init: ->
imgHover.el = $.el 'div', id: 'iHover' g.callbacks.push (root) ->
$.append d.body, imgHover.el return unless thumb = $ 'img[md5]', root
g.callbacks.push imgHover.node $.bind thumb, 'mouseover', imgHover.mouseover
node: (root) -> $.bind thumb, 'mousemove', ui.hover
return unless thumb = $ 'img[md5]', root $.bind thumb, 'mouseout', imgHover.mouseout
$.bind thumb, 'mouseover', imgHover.mouseover
$.bind thumb, 'mousemove', ui.hover
$.bind thumb, 'mouseout', imgHover.mouseout
mouseover: (e) -> mouseover: (e) ->
### ###
http://code.google.com/p/chromium/issues/detail?id=36142 http://code.google.com/p/chromium/issues/detail?id=36142
@ -1862,11 +1859,14 @@ imgHover =
instead of manipulating src, we manipulate the entire img instead of manipulating src, we manipulate the entire img
### ###
img = $.el 'img', src: @parentNode.href img = $.el 'img'
$.append imgHover.el, img id: 'iHover'
ui.el = imgHover.el src: @parentNode.href
imgHover.img = img
ui.el = img
$.append d.body, img
mouseout: (e) -> mouseout: (e) ->
$.rm imgHover.el.firstChild $.rm imgHover.img
imgPreloading = imgPreloading =
init: -> init: ->