Fix $tw.utils.pulseElement() (#9741)

* Fix $tw.utils.pulseElement() by replacing missing $tw.browser.animationEnd

Use $tw.utils.convertEventName("animationEnd") and add pulse CSS animation

Fixes #6835

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add ChangeNote

* add tc- prefix to pulse class

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mario Pietsch
2026-07-30 06:15:38 +02:00
committed by GitHub
co-authored by Claude Opus 4.6
parent ea18c85a4c
commit 916df90cc9
3 changed files with 29 additions and 5 deletions
+6 -5
View File
@@ -164,15 +164,16 @@ exports.forceLayout = function(element) {
Pulse an element for debugging purposes
*/
exports.pulseElement = function(element) {
var eventName = $tw.utils.convertEventName("animationEnd");
// Event handler to remove the class at the end
element.addEventListener($tw.browser.animationEnd,function handler(event) {
element.removeEventListener($tw.browser.animationEnd,handler,false);
$tw.utils.removeClass(element,"pulse");
element.addEventListener(eventName,function handler(event) {
element.removeEventListener(eventName,handler,false);
$tw.utils.removeClass(element,"tc-pulse");
},false);
// Apply the pulse class
$tw.utils.removeClass(element,"pulse");
$tw.utils.removeClass(element,"tc-pulse");
$tw.utils.forceLayout(element);
$tw.utils.addClass(element,"pulse");
$tw.utils.addClass(element,"tc-pulse");
};
/*