From: Joshua Rüsweg Date: Thu, 9 Aug 2018 09:49:01 +0000 (+0200) Subject: Add singleItem option for ReactionHandler X-Git-Tag: 5.2.0_Alpha_1~364^2~99 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9e75bbaea9090bda6708a3003650c6a4ba517cb7;p=GitHub%2FWoltLab%2FWCF.git Add singleItem option for ReactionHandler See #2508 --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js index a599e4221f..83911b8d52 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js @@ -53,6 +53,7 @@ define( buttonSelector: '.reactButton', containerSelector: '', isButtonGroupNavigation: false, + isSingleItem: false, // other stuff parameters: { @@ -102,7 +103,12 @@ define( * Initializes a specific react button. */ _initReactButton: function(element, elementData) { - elementData.reactButton = elBySel(this._options.buttonSelector, element); + if (this._options.isSingleItem) { + elementData.reactButton = elBySel(this._options.buttonSelector); + } + else { + elementData.reactButton = elBySel(this._options.buttonSelector, element); + } if (elementData.reactButton === null || elementData.reactButton.length === 0) { // the element may have no react button