From 13a6a04cadf126fef6d0bc85e0de0c15c8e59bb5 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 1 Apr 2019 16:23:57 +0200 Subject: [PATCH] FIX: ensures popover is hidden when changing route (#7300) --- .../javascripts/discourse/initializers/d-popover.js.es6 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/initializers/d-popover.js.es6 b/app/assets/javascripts/discourse/initializers/d-popover.js.es6 index 0fae353b8b2..d27837da32b 100644 --- a/app/assets/javascripts/discourse/initializers/d-popover.js.es6 +++ b/app/assets/javascripts/discourse/initializers/d-popover.js.es6 @@ -6,7 +6,10 @@ const SELECTORS = export default { name: "d-popover", - initialize() { + initialize(container) { + const router = container.lookup("router:main"); + router.on("routeWillChange", hidePopover); + $("#main").on("click.d-popover mouseenter.d-popover", SELECTORS, event => showPopover(event) );