Skip to content

Commit

Permalink
Update flagStory() to remove jQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
ymeynot45 committed Jun 27, 2022
1 parent ba3bb5d commit a842d92
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions app/assets/javascripts/application.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ var _Lobsters = Class.extend({
commentFlagReasons: { <%= Vote::COMMENT_REASONS.map{|k,v|
"#{k.inspect}: #{v.inspect}" }.join(", ") %> },

flagStory: function(voterEl) {
Lobsters._showFlagWhyAt("story", voterEl, function(k) {
Lobster.vote("story", voterEl, -1, k); });
},

_showFlagWhyAt: function(thingType, voterEl, onChooseWhy) {
if (!Lobsters.curUser)
return Lobster.bounceToLogin();
Expand Down Expand Up @@ -367,8 +362,9 @@ class _LobstersFunction {
Lobster.vote("comment", voterEl, -1, k); });
}

flagStory(voterEl) { //requires [_showFlagWhyAt]

flagStory(voterEl) {
Lobsters._showFlagWhyAt("story", voterEl, function(k) {
Lobster.vote("story", voterEl, -1, k); });
}

hideStory(hiderEl) {
Expand Down Expand Up @@ -573,7 +569,7 @@ onPageLoad(() => {

on('click', 'li.story a.flagger', (event) => {
event.preventDefault();
Lobsters.flagStory(event.target);
Lobster.flagStory(event.target);
});

on('click', 'li.story a.hider', (event) => {
Expand Down

0 comments on commit a842d92

Please sign in to comment.