make inline modals smoother
parent
7a79da454e
commit
3324a72985
|
@ -95,7 +95,7 @@ function populate_inline_emoji_modal(results, textbox)
|
|||
|
||||
emoji_option.addEventListener('click', () => {
|
||||
close_inline_emoji_modal()
|
||||
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=\\s|$)", "gi"), `:${name}: `)
|
||||
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=[^\\w-]|$)", "gi"), `:${name}: `)
|
||||
textbox.focus()
|
||||
if (typeof markdown === "function" && textbox.dataset.preview) {
|
||||
markdown(textbox)
|
||||
|
|
|
@ -105,7 +105,7 @@ function populate_inline_group_modal(results, textbox)
|
|||
|
||||
group_option.addEventListener('click', () => {
|
||||
close_inline_emoji_modal()
|
||||
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=\\s|$)", "gi"), `!${name} `)
|
||||
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=[^\\w-]|$)", "gi"), `!${name} `)
|
||||
textbox.focus()
|
||||
if (typeof markdown === "function" && textbox.dataset.preview) {
|
||||
markdown(textbox)
|
||||
|
|
|
@ -109,7 +109,7 @@ function populate_inline_user_modal(results, textbox)
|
|||
|
||||
user_option.addEventListener('click', () => {
|
||||
close_inline_emoji_modal()
|
||||
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=\\s|$)", "gi"), `@${name} `)
|
||||
textbox.value = textbox.value.replace(new RegExp(current_word+"(?=[^\\w-]|$)", "gi"), `@${name} `)
|
||||
textbox.focus()
|
||||
if (typeof markdown === "function" && textbox.dataset.preview) {
|
||||
markdown(textbox)
|
||||
|
|
Loading…
Reference in New Issue