mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-06-03 19:22:27 +00:00
Added $tw.utils.pulse() for animating elements
To make it easier to see things while debugging
This commit is contained in:
@@ -28,6 +28,13 @@ exports.getBrowserInfo = function(info) {
|
||||
"Moz": "transitionend",
|
||||
"webkit": "webkitTransitionEnd"
|
||||
}[info.prefix];
|
||||
info.animationEnd = {
|
||||
"": "animationEnd",
|
||||
"O": "oAnimationEnd",
|
||||
"MS": "msAnimationEnd",
|
||||
"Moz": "animationend",
|
||||
"webkit": "webkitAnimationEnd"
|
||||
}[info.prefix];
|
||||
info.requestFullScreen = document.body.webkitRequestFullScreen !== undefined ? "webkitRequestFullScreen" :
|
||||
document.body.mozRequestFullScreen !== undefined ? "mozRequestFullScreen" :
|
||||
document.body.requestFullScreen !== undefined ? "requestFullScreen" : "";
|
||||
|
||||
@@ -112,4 +112,19 @@ exports.forceLayout = function(element) {
|
||||
var dummy = element.offsetWidth;
|
||||
};
|
||||
|
||||
/*
|
||||
Pulse an element for debugging purposes
|
||||
*/
|
||||
exports.pulseElement = function(element) {
|
||||
// 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");
|
||||
},false);
|
||||
// Apply the pulse class
|
||||
$tw.utils.removeClass(element,"pulse");
|
||||
element.offsetWidth;
|
||||
$tw.utils.addClass(element,"pulse");
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user