From 5722e9a6e80a40c5825e2cd3d0c2b361f63cc872 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Mon, 28 May 2018 15:53:50 +0200 Subject: [PATCH] Toggle icon if the user react to an object See #2508 --- wcfsetup/install/files/images/reaction/reactionIcon.svg | 1 + .../files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 wcfsetup/install/files/images/reaction/reactionIcon.svg diff --git a/wcfsetup/install/files/images/reaction/reactionIcon.svg b/wcfsetup/install/files/images/reaction/reactionIcon.svg new file mode 100644 index 0000000000..04c6dfbc82 --- /dev/null +++ b/wcfsetup/install/files/images/reaction/reactionIcon.svg @@ -0,0 +1 @@ + \ No newline at end of file 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 2b7da0422e..27f2ce31f9 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js @@ -233,9 +233,15 @@ define( // update react button status if (data.returnValues.reactionTypeID) { this._containers.get(data.returnValues.objectID).reactButton.classList.add('active'); + + // update icon + this._containers.get(data.returnValues.objectID).reactButton.innerHTML = REACTION_TYPES[data.returnValues.reactionTypeID].renderedIcon; } else { this._containers.get(data.returnValues.objectID).reactButton.classList.remove('active'); + + // update icon + this._containers.get(data.returnValues.objectID).reactButton.innerHTML = ''; } }, -- 2.20.1