Move the TomSelect guard clause into TomSelect

This commit is contained in:
William Karsten 2022-08-31 08:24:55 -05:00
parent 9aae026829
commit 6382b00c51
1 changed files with 5 additions and 3 deletions

View File

@ -277,6 +277,10 @@ class _LobstersFunction {
}
tomSelect(item) {
if (!document.getElementById('story_tags_a')) {
return
}
TomSelect.define('caret_position', caret_position);
TomSelect.define('input_autogrow', input_autogrow);
TomSelect.define('remove_button', remove_button);
@ -490,9 +494,7 @@ onPageLoad(() => {
Lobster.checkStoryTitle()
if (document.getElementById('story_tags_a')) {
Lobster.tomSelect();
}
Lobster.tomSelect();
if (document.getElementById('story_url') && document.getElementById('story_preview') && !document.getElementById('story_preview').firstElementChild) {
document.getElementById('story_url').focus()