From a10010e64bf3d5b829babd64342ed03d7a248fd1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Wed, 1 Aug 2018 20:43:16 +0200 Subject: [PATCH] Ignore react buttons in mobile navigation See #2508 --- .../files/js/WoltLabSuite/Core/Ui/Like/Handler.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Like/Handler.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Like/Handler.js index b5fa93554f..8589418817 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Like/Handler.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Like/Handler.js @@ -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); -- 2.20.1