Files
url_tracker_tool/node_modules/dom-helpers/esm/transitionEnd.js
Andrei 58f8093689 Rebrand from 'Redirect Intelligence v2' to 'URL Tracker Tool V2' throughout UI
- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
2025-08-19 19:12:23 +00:00

39 lines
1.0 KiB
JavaScript

import css from './css';
import listen from './listen';
import triggerEvent from './triggerEvent';
function parseDuration(node) {
var str = css(node, 'transitionDuration') || '';
var mult = str.indexOf('ms') === -1 ? 1000 : 1;
return parseFloat(str) * mult;
}
function emulateTransitionEnd(element, duration, padding) {
if (padding === void 0) {
padding = 5;
}
var called = false;
var handle = setTimeout(function () {
if (!called) triggerEvent(element, 'transitionend', true);
}, duration + padding);
var remove = listen(element, 'transitionend', function () {
called = true;
}, {
once: true
});
return function () {
clearTimeout(handle);
remove();
};
}
export default function transitionEnd(element, handler, duration, padding) {
if (duration == null) duration = parseDuration(element) || 0;
var removeEmulate = emulateTransitionEnd(element, duration, padding);
var remove = listen(element, 'transitionend', handler);
return function () {
removeEmulate();
remove();
};
}