1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Fix problem with pop listview animation

It turns out the transitionEnd event fires separately for each animated
property. We'll just remove ourselves on the first one
This commit is contained in:
Jeremy Ruston 2013-07-05 11:15:51 +01:00
parent 280d4dc181
commit 6d3f224817

View File

@ -48,10 +48,12 @@ PopListView.prototype.remove = function(index) {
var listElementNode = this.listWidget.children[index],
targetElement = listElementNode.domNode;
// Attach an event handler for the end of the transition
targetElement.addEventListener($tw.utils.convertEventName("transitionEnd"),function(event) {
var transitionEventName = $tw.utils.convertEventName("transitionEnd");
targetElement.addEventListener(transitionEventName,function handler(event) {
if(targetElement.parentNode) {
targetElement.parentNode.removeChild(targetElement);
}
targetElement.removeEventListener(transitionEventName,handler,false);
},false);
// Animate the closure
$tw.utils.setStyle(targetElement,[