From: Alexander Ebert Date: Mon, 8 Feb 2016 12:37:15 +0000 (+0100) Subject: Added support for like badge in .messageStatus X-Git-Tag: 3.0.0_Beta_1~2030^2~100 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=30a22074e108edf657de83f394be93ecd7ba9dd4;p=GitHub%2FWoltLab%2FWCF.git Added support for like badge in .messageStatus --- diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Like/Handler.js b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Like/Handler.js index 81ac286b04..d0d8d09e49 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Ui/Like/Handler.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Ui/Like/Handler.js @@ -141,14 +141,22 @@ define( } // cumulative likes - var badge, badgeContainer = elBySel(this._options.badgeContainerSelector, element); + var badge, badgeContainer = elBySel(this._options.badgeContainerSelector, element), listItem; if (badgeContainer !== null) { badge = elCreate('a'); badge.href = '#'; badge.className = 'wcfLikeCounter jsTooltip' + (this._options.badgeClassNames ? ' ' + this._options.badgeClassNames : ''); badge.addEventListener('click', this._showSummary.bind(this, element)); - badgeContainer.appendChild(badge); + if (badgeContainer.nodeName === 'OL' || badgeContainer.nodeName === 'UL') { + listItem = elCreate('li'); + listItem.appendChild(badge); + badgeContainer.appendChild(listItem); + } + else { + badgeContainer.appendChild(badge); + } + elementData.badge = badge; this._updateBadge(element);