From be3c4abbcee71ec7e326049fcceb870140a9c1e8 Mon Sep 17 00:00:00 2001 From: Ashley Williams Date: Sun, 23 Mar 2014 21:05:56 -0700 Subject: [PATCH] Fixed: CPPopover not closing in some browsers In browsers without support for _DOMElement.removeEventListener CPPopover throws an exception when closing, and the popover is not removed. This fix checks for support implicitly using the _browserAnimates variable. --- AppKit/_CPPopoverWindow.j | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AppKit/_CPPopoverWindow.j b/AppKit/_CPPopoverWindow.j index 899fab08b..593bd7dc6 100644 --- a/AppKit/_CPPopoverWindow.j +++ b/AppKit/_CPPopoverWindow.j @@ -588,7 +588,10 @@ var _CPPopoverWindow_shouldClose_ = 1 << 4, { // Make absolutely sure no dangling event listeners are left #if PLATFORM(DOM) - _DOMElement.removeEventListener(CPBrowserStyleProperty("transitionend"), _orderOutTransitionFunction, YES); + if (_animates && _browserAnimates) + { + _DOMElement.removeEventListener(CPBrowserStyleProperty("transitionend"), _orderOutTransitionFunction, YES); + } #endif [self _removeFrameObserver];