N°2039 - Refresh messages without waiting for the providers TTL to avoid news not being visible even though they have been created

This commit is contained in:
Molkobain
2024-05-02 17:44:25 +02:00
parent e680259728
commit a642ad6db9

View File

@@ -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',