From 9e75bbaea9090bda6708a3003650c6a4ba517cb7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Thu, 9 Aug 2018 11:49:01 +0200 Subject: [PATCH] Add singleItem option for ReactionHandler See #2508 --- .../files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.20.1