Fix Quote Hash Navigation on Backlinks (again)

This commit is contained in:
Zixaphir 2014-03-06 21:20:26 -07:00
parent bc15231170
commit 7bc8447d3f
4 changed files with 23 additions and 12 deletions

View File

@ -5263,6 +5263,9 @@
}
if (Conf['Quote Inlining']) {
$.on(a, 'click', QuoteInline.toggle);
if (Conf['Quote Hash Navigation']) {
QuoteInline.qiQuote(a, quoter.isHidden);
}
}
return frag;
}
@ -5274,10 +5277,11 @@
return;
}
this.process = Conf['Quote Hash Navigation'] ? function(link, clone) {
if (!clone) {
$.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered')));
$.on(link, 'click', QuoteInline.toggle);
if (clone) {
return;
}
return $.on(link, 'click', QuoteInline.toggle);
return QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'));
} : function(link) {
return $.on(link, 'click', QuoteInline.toggle);
};
@ -5310,11 +5314,11 @@
if (hidden) {
name += "filtered";
}
return $.el('a', {
return $.after(link, $.el('a', {
className: name,
textContent: '#',
href: link.href
});
}));
},
toggle: function(e) {
var boardID, context, postID, threadID, _ref;

View File

@ -5315,6 +5315,9 @@
}
if (Conf['Quote Inlining']) {
$.on(a, 'click', QuoteInline.toggle);
if (Conf['Quote Hash Navigation']) {
QuoteInline.qiQuote(a, quoter.isHidden);
}
}
return frag;
}
@ -5326,10 +5329,11 @@
return;
}
this.process = Conf['Quote Hash Navigation'] ? function(link, clone) {
if (!clone) {
$.after(link, QuoteInline.qiQuote(link, $.hasClass(link, 'filtered')));
$.on(link, 'click', QuoteInline.toggle);
if (clone) {
return;
}
return $.on(link, 'click', QuoteInline.toggle);
return QuoteInline.qiQuote(link, $.hasClass(link, 'filtered'));
} : function(link) {
return $.on(link, 'click', QuoteInline.toggle);
};
@ -5362,11 +5366,11 @@
if (hidden) {
name += "filtered";
}
return $.el('a', {
return $.after(link, $.el('a', {
className: name,
textContent: '#',
href: link.href
});
}));
},
toggle: function(e) {
var boardID, context, postID, threadID, _ref;

View File

@ -69,4 +69,6 @@ QuoteBacklink =
$.on a, 'mouseover', QuotePreview.mouseover
if Conf['Quote Inlining']
$.on a, 'click', QuoteInline.toggle
if Conf['Quote Hash Navigation']
QuoteInline.qiQuote a, quoter.isHidden
frag

View File

@ -4,8 +4,9 @@ QuoteInline =
@process = if Conf['Quote Hash Navigation']
(link, clone) ->
$.after link, QuoteInline.qiQuote link, $.hasClass link, 'filtered' unless clone
$.on link, 'click', QuoteInline.toggle
return if clone
QuoteInline.qiQuote link, $.hasClass link, 'filtered'
else
(link) ->
@ -28,7 +29,7 @@ QuoteInline =
qiQuote: (link, hidden) ->
name = "hashlink"
name += "filtered" if hidden
$.el 'a',
$.after link, $.el 'a',
className: name
textContent: '#'
href: link.href