From a642ad6db94b858033af4cf07fcc52827d9ac629 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Thu, 2 May 2024 17:44:25 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B02039=20-=20Refresh=20messages=20without?= =?UTF-8?q?=20waiting=20for=20the=20providers=20TTL=20to=20avoid=20news=20?= =?UTF-8?q?not=20being=20visible=20even=20though=20they=20have=20been=20cr?= =?UTF-8?q?eated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/components/newsroom-menu.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/components/newsroom-menu.js b/js/components/newsroom-menu.js index ddce9d7f8..a03b6ac4d 100644 --- a/js/components/newsroom-menu.js +++ b/js/components/newsroom-menu.js @@ -45,11 +45,15 @@ $(function() // Important: For now, the popover menu is manually instantiated even though the PHP NewsroomMenu class inherits PopoverMenu because the jQuery widget doesn't. We might refactor this in the future. $(me.element).popover_menu({'toggler': this.js_selectors.menu_toggler}); - $(this.js_selectors.menu_toggler).on('click', function (oEvent) { + $(this.js_selectors.menu_toggler).off('click').on('click', function (oEvent) { var oEventTarget = $(oEvent.target); var aEventTargetPos = oEventTarget.position(); var aEventTargetOffset = oEventTarget.offset(); + // N°2039 - When opening the menu, refresh messages without waiting for the providers TTL to avoid news not being visible even though they have been created + me.clearCache(); + me._getAllMessages(); + $iHeight = Math.abs(aEventTargetOffset.top-100); $(me.element).css({ 'max-height': $iHeight+'px',