Files
nairobi/app/assets/javascripts/votes.js
Javi Martín f11fd2b13e Remove duplication in comments votes component
We're also simplifying the code a bit by removing the
`participation-allowed` HTML class, which wasn't used in any other votes
component.
2022-02-21 18:47:13 +01:00

22 lines
572 B
JavaScript

(function() {
"use strict";
App.Votes = {
hoverize: function(votes) {
$(document).on({
"mouseenter focus": function() {
$("div.participation-not-allowed", this).show();
},
mouseleave: function() {
$("div.participation-not-allowed", this).hide();
}
}, votes);
},
initialize: function() {
App.Votes.hoverize("div.votes");
App.Votes.hoverize("div.supports");
App.Votes.hoverize("div.debate-questions");
App.Votes.hoverize("div.comment-footer");
}
};
}).call(this);