1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-31 23:53:00 +00:00

Fix up some problems when the animation duration is zero

We want to be able to suppress animations by making the duration zero
This commit is contained in:
Jeremy Ruston
2013-08-29 12:43:24 +01:00
parent 6333749d68
commit ee33cbbc2e
3 changed files with 13 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ Notifier.prototype.display = function(title,options) {
// Create the wrapper divs
var notification = document.createElement("div"),
tiddler = this.wiki.getTiddler(title),
d = $tw.utils.getAnimationDuration() + "ms";
duration = $tw.utils.getAnimationDuration();
// Don't do anything if the tiddler doesn't exist
if(!tiddler) {
return;
@@ -47,7 +47,7 @@ Notifier.prototype.display = function(title,options) {
{opacity: "0"},
{transformOrigin: "0% 0%"},
{transform: "translateY(" + (-window.innerHeight) + "px)"},
{transition: "opacity " + d + " ease-out, " + $tw.utils.roundTripPropertyName("transform") + " " + d + " ease-in-out"}
{transition: "opacity " + duration + "ms ease-out, " + $tw.utils.roundTripPropertyName("transform") + " " + duration + "ms ease-in-out"}
]);
// Add the notification to the DOM
document.body.appendChild(notification);