mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-02-12 13:09:50 +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:
@@ -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,[
|
||||
|
||||
Reference in New Issue
Block a user