Skip to content

Commit

Permalink
Correct user assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
ymeynot45 committed Jun 29, 2022
1 parent 40f869e commit a7299e8
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions app/assets/javascripts/application.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,13 @@ const removeExtraInputs = () => {

class _LobstersFunction {
constructor () {
this.curUser = 'will'; // remove line when done with production
// this.curUser = null, //for finished product
this.curUser = document.body.getAttribute('data-username');

this.storyFlagReasons = ({<%= Vote::STORY_REASONS.map{|k,v|
"#{k.inspect}: #{v.inspect}" }.join(", ") %>});
this.storyFlagReasons = ({<%= Vote::STORY_REASONS.map{|k,v|
"#{k.inspect}: #{v.inspect}" }.join(", ") %>});

this.commentFlagReasons = ({<%= Vote::COMMENT_REASONS.map{|k,v|
"#{k.inspect}: #{v.inspect}" }.join(", ") %>});
this.commentFlagReasons = ({<%= Vote::COMMENT_REASONS.map{|k,v|
"#{k.inspect}: #{v.inspect}" }.join(", ") %>});
}

bounceToLogin() {
Expand All @@ -346,7 +345,7 @@ class _LobstersFunction {

checkStoryTitle() { //partial removal (due to select2)
const titleLocation = document.getElementById('story_title');
if(!titleLocation) return;
if (!titleLocation) return;

const title = titleLocation.value;
if (!title) return;
Expand Down Expand Up @@ -543,12 +542,12 @@ class _LobstersFunction {
}
}

const Lobster = new _LobstersFunction();

onPageLoad(() => {

// Global Functions

const Lobster = new _LobstersFunction();

on('click', '.markdown_help_label', (event) => {
parentSelector(event.target, '.markdown_help_toggler').querySelector('.markdown_help').classList.toggle('display-block');
});
Expand Down

0 comments on commit a7299e8

Please sign in to comment.