Use transitionend event instead of timer in Android touch menu
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 1 Sep 2016 15:55:24 +0000 (17:55 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 1 Sep 2016 15:55:46 +0000 (17:55 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Page/Menu/Abstract.js

index 4aef7491c285a9c947478c747adfe56c4b85f62c..4b47db7c02371d599f7740cd105e331d4a1a9401 100644 (file)
@@ -250,9 +250,9 @@ define(['Core', 'Environment', 'EventHandler', 'ObjectMap', 'Dom/Traverse', 'Dom
                                this._menu.classList.add('androidMenuTouchEnd');
                                this._menu.style.removeProperty('transform');
                                backdrop.style.removeProperty(appearsAt);
-                               setTimeout((function() {
+                               this._menu.addEventListener('transitionend', (function() {
                                        this._menu.classList.remove('androidMenuTouchEnd');
-                               }).bind(this), 300);
+                               }).bind(this), { once: true });
                                
                                // check whether the user moved the finger far enough
                                if (appearsAt === 'left') {