Fixed quick options being visible for non-action messages
authorAlexander Ebert <ebert@woltlab.com>
Sun, 2 Oct 2016 11:04:47 +0000 (13:04 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 2 Oct 2016 11:04:47 +0000 (13:04 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Mobile.js

index 6af62f2dba4dc27b62f1d13fef94cdeb61fe4634..708ef7ce1c85e7916902f62aae1ff0a09aae4b38 100644 (file)
@@ -175,18 +175,6 @@ define(
                                }
                                
                                var navigation = elBySel('.jsMobileNavigation', message);
-                               var quickOptions = elBySel('.messageQuickOptions', message);
-                               
-                               if (quickOptions) {
-                                       quickOptions.addEventListener(WCF_CLICK_EVENT, function (event) {
-                                               if (_enabled) {
-                                                       event.preventDefault();
-                                                       event.stopPropagation();
-                                                       
-                                                       navigation.classList.toggle('open');
-                                               }
-                                       });
-                               }
                                if (navigation) {
                                        navigation.addEventListener(WCF_CLICK_EVENT, function(event) {
                                                event.stopPropagation();
@@ -196,6 +184,23 @@ define(
                                                        navigation.classList.remove('open');
                                                }, 10);
                                        });
+                                       
+                                       var quickOptions = elBySel('.messageQuickOptions', message);
+                                       if (quickOptions) {
+                                               if (navigation.childElementCount) {
+                                                       quickOptions.addEventListener(WCF_CLICK_EVENT, function (event) {
+                                                               if (_enabled) {
+                                                                       event.preventDefault();
+                                                                       event.stopPropagation();
+                                                                       
+                                                                       navigation.classList.toggle('open');
+                                                               }
+                                                       });
+                                               }
+                                               else {
+                                                       elHide(quickOptions);
+                                               }
+                                       }
                                }
                                
                                _knownMessages.add(message);