Prevent quote previewing on already inlined quotes.

This commit is contained in:
Nicolas Stepien 2012-02-10 21:01:46 +01:00
parent fcc01e6a39
commit 605363c363
2 changed files with 8 additions and 2 deletions

View File

@ -2950,6 +2950,7 @@
}, },
mouseover: function(e) { mouseover: function(e) {
var el, id, qp, quote, replyID, threadID, _i, _len, _ref; var el, id, qp, quote, replyID, threadID, _i, _len, _ref;
if (/\binlined\b/.test(this.className)) return;
qp = ui.el = $.el('div', { qp = ui.el = $.el('div', {
id: 'qp', id: 'qp',
className: 'reply dialog' className: 'reply dialog'
@ -2976,14 +2977,16 @@
ui.hover(e); ui.hover(e);
} }
$.on(this, 'mousemove', ui.hover); $.on(this, 'mousemove', ui.hover);
return $.on(this, 'mouseout', quotePreview.mouseout); $.on(this, 'mouseout', quotePreview.mouseout);
return $.on(this, 'click', quotePreview.mouseout);
}, },
mouseout: function() { mouseout: function() {
var el; var el;
if (el = $.id(this.hash.slice(1))) $.removeClass(el, 'qphl'); if (el = $.id(this.hash.slice(1))) $.removeClass(el, 'qphl');
ui.hoverend(); ui.hoverend();
$.off(this, 'mousemove', ui.hover); $.off(this, 'mousemove', ui.hover);
return $.off(this, 'mouseout', quotePreview.mouseout); $.off(this, 'mouseout', quotePreview.mouseout);
return $.off(this, 'click', quotePreview.mouseout);
}, },
parse: function(req, id, threadID) { parse: function(req, id, threadID) {
var body, html, op, qp, reply, _i, _len, _ref; var body, html, op, qp, reply, _i, _len, _ref;

View File

@ -2316,6 +2316,7 @@ quotePreview =
$.on quote, 'mouseover', quotePreview.mouseover if quote.hash $.on quote, 'mouseover', quotePreview.mouseover if quote.hash
return return
mouseover: (e) -> mouseover: (e) ->
return if /\binlined\b/.test @className
qp = ui.el = $.el 'div', qp = ui.el = $.el 'div',
id: 'qp' id: 'qp'
className: 'reply dialog' className: 'reply dialog'
@ -2337,12 +2338,14 @@ quotePreview =
ui.hover e ui.hover e
$.on @, 'mousemove', ui.hover $.on @, 'mousemove', ui.hover
$.on @, 'mouseout', quotePreview.mouseout $.on @, 'mouseout', quotePreview.mouseout
$.on @, 'click', quotePreview.mouseout
mouseout: -> mouseout: ->
if el = $.id @hash[1..] if el = $.id @hash[1..]
$.removeClass el, 'qphl' $.removeClass el, 'qphl'
ui.hoverend() ui.hoverend()
$.off @, 'mousemove', ui.hover $.off @, 'mousemove', ui.hover
$.off @, 'mouseout', quotePreview.mouseout $.off @, 'mouseout', quotePreview.mouseout
$.off @, 'click', quotePreview.mouseout
parse: (req, id, threadID) -> parse: (req, id, threadID) ->
return unless (qp = ui.el) and (qp.innerHTML is "Loading #{id}...") return unless (qp = ui.el) and (qp.innerHTML is "Loading #{id}...")