mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2025-12-26 11:53:26 -08: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:
parent
280d4dc181
commit
6d3f224817
1 changed files with 3 additions and 1 deletions
|
|
@ -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,[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue