From 7b013af240e9092b008739f61c995e7fb4cbe481 Mon Sep 17 00:00:00 2001 From: Simon Huber Date: Wed, 17 Dec 2025 15:51:32 +0100 Subject: [PATCH] Update reveal.js to position popups correctly when animated (#9239) --- core/modules/widgets/reveal.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/modules/widgets/reveal.js b/core/modules/widgets/reveal.js index 14d5ff0d72..b391e07e3b 100755 --- a/core/modules/widgets/reveal.js +++ b/core/modules/widgets/reveal.js @@ -252,14 +252,14 @@ RevealWidget.prototype.updateState = function() { this.renderChildren(domNode,null); } // Animate our DOM node - if(!domNode.isTiddlyWikiFakeDom && this.type === "popup" && this.isOpen) { - this.positionPopup(domNode); - $tw.utils.addClass(domNode,"tc-popup"); // Make sure that clicks don't dismiss popups within the revealed content - - } if(this.isOpen) { domNode.removeAttribute("hidden"); - $tw.anim.perform(this.openAnimation,domNode); + // Position popup after making it visible to ensure correct dimensions + if(!domNode.isTiddlyWikiFakeDom && this.type === "popup") { + this.positionPopup(domNode); + $tw.utils.addClass(domNode,"tc-popup"); // Make sure that clicks don't dismiss popups within the revealed content + } + $tw.anim.perform(this.openAnimation,domNode); } else { $tw.anim.perform(this.closeAnimation,domNode,{callback: function() { //make sure that the state hasn't changed during the close animation