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

View File

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