Correct user assignment

This commit is contained in:
William Karsten 2022-06-29 08:20:50 -05:00
parent 40f869e7c3
commit a7299e84fc
1 changed files with 8 additions and 9 deletions

View File

@ -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() {
@ -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;
@ -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');
});