Concat quotelinks and backlinks for less loops.
This commit is contained in:
parent
a3face3746
commit
2e1bb104e5
@ -2572,9 +2572,7 @@ QuoteInline =
|
|||||||
name: 'Quote Inlining'
|
name: 'Quote Inlining'
|
||||||
cb: @node
|
cb: @node
|
||||||
node: ->
|
node: ->
|
||||||
for link in @nodes.quotelinks
|
for link in @nodes.quotelinks.concat [@nodes.backlinks...]
|
||||||
$.on link, 'click', QuoteInline.toggle
|
|
||||||
for link in @nodes.backlinks
|
|
||||||
$.on link, 'click', QuoteInline.toggle
|
$.on link, 'click', QuoteInline.toggle
|
||||||
return
|
return
|
||||||
toggle: (e) ->
|
toggle: (e) ->
|
||||||
@ -2653,9 +2651,7 @@ QuotePreview =
|
|||||||
name: 'Quote Previewing'
|
name: 'Quote Previewing'
|
||||||
cb: @node
|
cb: @node
|
||||||
node: ->
|
node: ->
|
||||||
for link in @nodes.quotelinks
|
for link in @nodes.quotelinks.concat [@nodes.backlinks...]
|
||||||
$.on link, 'mouseover', QuotePreview.mouseover
|
|
||||||
for link in @nodes.backlinks
|
|
||||||
$.on link, 'mouseover', QuotePreview.mouseover
|
$.on link, 'mouseover', QuotePreview.mouseover
|
||||||
return
|
return
|
||||||
mouseover: (e) ->
|
mouseover: (e) ->
|
||||||
@ -2688,10 +2684,7 @@ QuotePreview =
|
|||||||
|
|
||||||
quoterID = $.x('ancestor::*[@id][1]', @).id.match(/\d+$/)[0]
|
quoterID = $.x('ancestor::*[@id][1]', @).id.match(/\d+$/)[0]
|
||||||
clone = Get.postFromRoot qp.firstChild
|
clone = Get.postFromRoot qp.firstChild
|
||||||
for quote in clone.nodes.quotelinks
|
for quote in clone.nodes.quotelinks.concat [clone.nodes.backlinks...]
|
||||||
if quote.hash[2..] is quoterID
|
|
||||||
$.addClass quote, 'forwardlink'
|
|
||||||
for quote in clone.nodes.backlinks
|
|
||||||
if quote.hash[2..] is quoterID
|
if quote.hash[2..] is quoterID
|
||||||
$.addClass quote, 'forwardlink'
|
$.addClass quote, 'forwardlink'
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user