From 937ed9477103df6257936fc8b19b9fcf3d52d12d Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 6 Jul 2019 14:38:55 -0700 Subject: [PATCH] Create buttons by cloning template. #2282 --- src/Miscellaneous/PostJumper.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Miscellaneous/PostJumper.coffee b/src/Miscellaneous/PostJumper.coffee index e3d46d0a6..fca0e913a 100644 --- a/src/Miscellaneous/PostJumper.coffee +++ b/src/Miscellaneous/PostJumper.coffee @@ -4,6 +4,7 @@ PostJumper = @capcode = Object.create(null) @uniqueID = Object.create(null) + @buttons = @makeButtons() Callbacks.Post.push name: 'Post Jumper' @@ -18,7 +19,7 @@ PostJumper = addButtons: (post,type) -> value = post.nodes[type].innerText - buttons = PostJumper.makeButtons type+'Jumper' + buttons = PostJumper.buttons.cloneNode(true) $.after post.nodes[type+(if type is 'capcode' then '' else 'Root')], buttons $.on buttons.firstChild, 'click', PostJumper.buttonClick post,type,-1 $.on buttons.lastChild, 'click', PostJumper.buttonClick post,type,1