From f3acc9273077de2990a26bf6574ab129e4f9f5e0 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 9 Feb 2013 17:18:00 +0000 Subject: [PATCH] Tweak removal animation in classic list view --- core/modules/widgets/list/listviews/classic.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/list/listviews/classic.js b/core/modules/widgets/list/listviews/classic.js index 7e6efabdc..ada3b91db 100644 --- a/core/modules/widgets/list/listviews/classic.js +++ b/core/modules/widgets/list/listviews/classic.js @@ -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);