This commit is contained in:
Nicolas Stepien 2012-05-28 14:29:11 +02:00
parent e80fc5a762
commit a82665c9c1
2 changed files with 13 additions and 5 deletions

View File

@ -256,6 +256,9 @@
} }
}, },
hoverend: function() { hoverend: function() {
if (!UI.el) {
return;
}
$.rm(UI.el); $.rm(UI.el);
return delete UI.el; return delete UI.el;
} }
@ -3207,9 +3210,7 @@
if (/\binlined\b/.test(this.className)) { if (/\binlined\b/.test(this.className)) {
return; return;
} }
if (qp = $.id('qp')) { UI.hoverend();
$.rm(qp);
}
qp = UI.el = $.el('div', { qp = UI.el = $.el('div', {
id: 'qp', id: 'qp',
className: 'post reply dialog' className: 'post reply dialog'
@ -3647,6 +3648,7 @@
return $.on(post.img, 'mouseover', ImageHover.mouseover); return $.on(post.img, 'mouseover', ImageHover.mouseover);
}, },
mouseover: function() { mouseover: function() {
UI.hoverend();
UI.el = $.el('img', { UI.el = $.el('img', {
id: 'ihover', id: 'ihover',
src: this.parentNode.href src: this.parentNode.href

View File

@ -230,6 +230,7 @@ UI =
style.right = clientWidth - clientX + 45 + 'px' style.right = clientWidth - clientX + 45 + 'px'
hoverend: -> hoverend: ->
return unless UI.el
$.rm UI.el $.rm UI.el
delete UI.el delete UI.el
@ -2431,8 +2432,10 @@ QuotePreview =
return return
mouseover: (e) -> mouseover: (e) ->
return if /\binlined\b/.test @className return if /\binlined\b/.test @className
if qp = $.id 'qp'
$.rm qp # Make sure to remove the previous UI.el
UI.hoverend()
qp = UI.el = $.el 'div', qp = UI.el = $.el 'div',
id: 'qp' id: 'qp'
className: 'post reply dialog' className: 'post reply dialog'
@ -2771,6 +2774,9 @@ ImageHover =
return unless post.img return unless post.img
$.on post.img, 'mouseover', ImageHover.mouseover $.on post.img, 'mouseover', ImageHover.mouseover
mouseover: -> mouseover: ->
# Make sure to remove the previous UI.el
UI.hoverend()
UI.el = $.el 'img' UI.el = $.el 'img'
id: 'ihover' id: 'ihover'
src: @parentNode.href src: @parentNode.href