1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-19 00:04:51 +00:00

Tweak removal animation in classic list view

This commit is contained in:
Jeremy Ruston 2013-02-09 17:18:00 +00:00
parent 91002165af
commit f3acc92730

View File

@ -63,7 +63,9 @@ ClassicListView.prototype.remove = function(index) {
targetElement = listElementNode.domNode;
// Get the current height of the tiddler
var currWidth = targetElement.offsetWidth,
currHeight = targetElement.offsetHeight + parseInt(window.getComputedStyle(targetElement).marginTop,10);
currMarginBottom = parseInt(window.getComputedStyle(targetElement).marginBottom,10),
currMarginTop = parseInt(window.getComputedStyle(targetElement).marginTop,10),
currHeight = targetElement.offsetHeight + currMarginTop;
// Attach an event handler for the end of the transition
targetElement.addEventListener($tw.utils.convertEventName("transitionEnd"),function(event) {
if(targetElement.parentNode) {
@ -74,7 +76,7 @@ ClassicListView.prototype.remove = function(index) {
$tw.utils.setStyle(targetElement,[
{transition: "none"},
{transform: "translateX(0px)"},
{marginBottom: "0px"},
{marginBottom: currMarginBottom + "px"},
{opacity: "1.0"}
]);
$tw.utils.forceLayout(targetElement);