* add loading indicator.
This commit is contained in:
@@ -83,6 +83,10 @@
|
||||
publishButton.addEventListener('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
const container = publishButton.ownerDocument.defaultView.parent.document.querySelector('.load-indicator');
|
||||
if(container) container.classList.toggle('loading', true);
|
||||
|
||||
const promptId = publishButton.dataset.promptid;
|
||||
const aTag = document.createElement('a');
|
||||
aTag.href = createLink('ai', 'promptPublish', 'promptId=' + promptId + '&$backToTestingLocation=true');
|
||||
@@ -91,6 +95,16 @@
|
||||
aTag.click();
|
||||
});
|
||||
}
|
||||
|
||||
const regenerateButton = document.getElementById('promptRegenerate');
|
||||
if(regenerateButton)
|
||||
{
|
||||
regenerateButton.addEventListener('click', function()
|
||||
{
|
||||
const container = regenerateButton.ownerDocument.defaultView.parent.document.querySelector('.load-indicator');
|
||||
if(container) container.classList.toggle('loading', true);
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<?php endif;?>
|
||||
|
||||
Reference in New Issue
Block a user