From 8f9b27d5beb2fd0d5a7454777f17497329910621 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Thu, 23 Jun 2022 22:30:56 -0700 Subject: [PATCH] Update order of the menu items Report item gets added first in the menu now. Signed-off-by: Alek Ratzloff --- board/static/board/post.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/board/static/board/post.js b/board/static/board/post.js index f090462..8854f56 100644 --- a/board/static/board/post.js +++ b/board/static/board/post.js @@ -73,16 +73,19 @@ function openReportWindow(e, postElement) { function onLoad(e) { window.reportWindow = null; - window.menuItemFactories.push( - (postElement) => - $("") - .text("Report") - .attr("href", "#") - .on("click", (e) => { return openReportWindow(e, postElement); }) - ); } $(document).on("click", documentClick); $(document).on("click", ".post_id", doQuote); -$(window).on("load", onLoad); -window.menuItemFactories = []; \ No newline at end of file +$(window).on("load", () => { + window.reportWindow = null; +}); + +window.menuItemFactories = []; +window.menuItemFactories.push( + (postElement) => + $("") + .text("Report") + .attr("href", "#") + .on("click", (e) => { return openReportWindow(e, postElement); }) +); \ No newline at end of file