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
print-window-tiddler
Jeremy Ruston 2013-07-05 11:15:51 +01:00
rodzic 280d4dc181
commit 6d3f224817
1 zmienionych plików z 3 dodań i 1 usunięć
core/modules/widgets/list/listviews

Wyświetl plik

@ -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,[