Update the function for the user homepage input in account settings to remove jQuery

This commit is contained in:
William Karsten 2022-06-13 16:20:42 -05:00
parent 456b8d5c41
commit 6a9d8f1a3f
1 changed files with 9 additions and 5 deletions

View File

@ -428,11 +428,6 @@ $(document).ready(function() {
Lobsters.checkStoryDuplicate($(this).parents("form").first());
}
});
$(document).on("blur", "#user_homepage", function() {
if (this.value.trim() !== '' && !this.value.match('^[a-z]+:\/\/'))
this.value = 'http://' + this.value;
});
});
const parentSelector = (target, selector) => {
@ -491,6 +486,15 @@ onPageLoad(() => {
parentSelector(event.target, '.markdown_help_toggler').querySelector('.markdown_help').classList.toggle('display-block');
});
// Account Settings Functions
on('focusout', '#user_homepage', (event) => {
const homePage = event.target
console.log("homepage", homePage)
if (homePage.value.trim() !== '' && !homePage.value.match('^[a-z]+:\/\/'))
homePage.value = 'https://' + homePage.value
})
// Inbox Related Funtions
on('change', '#message_hat_id', (event) => {