Ignore react buttons in mobile navigation
authorJoshua Rüsweg <josh@bastelstu.be>
Wed, 1 Aug 2018 18:43:16 +0000 (20:43 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Wed, 1 Aug 2018 18:43:16 +0000 (20:43 +0200)
See #2508

wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Like/Handler.js

index b5fa93554fb86eb4d268422a85f8bf2a586b6a7b..858941881762aa26f6a18678a88016383b795e0c 100644 (file)
@@ -202,8 +202,15 @@ define(
                        var listItem = elCreate('li');
                        listItem.className = 'wcfReactButton';
                        
+                       if (insertBefore) {
+                               var jsMobileNavigation = insertBefore.parentElement.contains('jsMobileNavigation');
+                       }
+                       else {
+                               var jsMobileNavigation = appendTo.classList.contains('jsMobileNavigation');
+                       }
+                       
                        var button = elCreate('a');
-                       button.className = 'jsTooltip reactButton' + (this._options.renderAsButton ? ' button' : '');
+                       button.className = 'jsTooltip reactButton' + (this._options.renderAsButton ? ' button' + (jsMobileNavigation ? ' ignoreMobileNavigation' : '') : '');
                        button.href = '#';
                        button.title = title;
                        
@@ -227,7 +234,7 @@ define(
                        invisibleText.className = "invisible";
                        invisibleText.innerHTML = title;
                        
-                       button.appendChild(document.createTextNode (" "));
+                       button.appendChild(document.createTextNode(" "));
                        button.appendChild(invisibleText);
                        
                        listItem.appendChild(button);