mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-16 06:41:21 +00:00
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:
co-authored by
Claude Opus 4.6
parent
ea18c85a4c
commit
916df90cc9
@@ -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");
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user