From 6bb8d79b2ab9037f40174ad8c2aff08890b23cb7 Mon Sep 17 00:00:00 2001 From: Dan Mayer Date: Tue, 7 May 2019 20:36:04 -0600 Subject: [PATCH] clear notice message so it doesn't appear on refreshes and shared links --- public/application.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/public/application.js b/public/application.js index da7faa71..3850eec4 100644 --- a/public/application.js +++ b/public/application.js @@ -1,4 +1,17 @@ $(document).ready(function() { + // remove the url params like notice=message so they don't stick around + window.history.replaceState( + "object or string", + "Coverband", + window.location.pathname + + window.location.href + .substring(window.location.href.lastIndexOf("/") + 1) + .split("?")[0] + ); + $(".notice") + .delay(3000) + .fadeOut("slow"); + $(".del").click(function() { if (!confirm("Do you want to delete")) { return false;