FIX: the ability to remove the vote (#55)

FIX: the ability to remove the vote (#55)

Problem was that we are adding hidden class to popup and jQuery toggle() function is not handling that properly. Therefore I decided to use toggleClass in that case and it works pretty well.

The bug was mentioned here - https://meta.discourse.org/t/voting-plugin/157676/8

diff --git a/assets/javascripts/discourse/widgets/vote-button.js.es6 b/assets/javascripts/discourse/widgets/vote-button.js.es6
index f35a3a8..47100d7 100644
--- a/assets/javascripts/discourse/widgets/vote-button.js.es6
+++ b/assets/javascripts/discourse/widgets/vote-button.js.es6
@@ -84,12 +84,12 @@ export default createWidget("vote-button", {
       this.sendWidgetAction("addVote");
     }
     if (this.attrs.user_voted || this.currentUser.votes_exceeded) {
-      $(".vote-options").toggle();
+      $(".vote-options").toggleClass("hidden");
     }
   },
 
   clickOutside() {
-    $(".vote-options").hide();
+    $(".vote-options").addClass("hidden");
     this.parentWidget.state.initialVote = false;
   },
 });

GitHub sha: b564224c

This commit appears in #55 which was merged by lis2.

Do we even need to use jQuery here?