From 7394ab0852be1c90cb3116b565635e9cbf83661e Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sun, 2 Oct 2016 09:35:52 -0400 Subject: [PATCH] Fix copy-to-clipboard links in highlighted code blocks --- assets/javascripts/views/pages/base.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/views/pages/base.coffee b/assets/javascripts/views/pages/base.coffee index 41ffbf48..7f93bf1d 100644 --- a/assets/javascripts/views/pages/base.coffee +++ b/assets/javascripts/views/pages/base.coffee @@ -37,7 +37,12 @@ class app.views.BasePage extends app.View @nodesPerFrame = Math.round(Math.max(@nodesPerFrame * .8, 10)) else @nodesPerFrame = 10 - Prism.highlightElement(el) for el in @highlightNodes.splice(0, @nodesPerFrame) + + for el in @highlightNodes.splice(0, @nodesPerFrame) + $.remove(clipEl) if clipEl = el.lastElementChild + Prism.highlightElement(el) + $.append(el, clipEl) if clipEl + $.requestAnimationFrame(@paintCode) if @highlightNodes.length > 0 @previousTiming = timing return