Skip to content

Commit e4c67d7

Browse files
committed
Add safeguard to tooltip hide in showSpinner
Firefox had a problem with autosaving a submission upon launching an exercise, since the tooltips were not fully initialized yet. Other browsers (Safari and Chrome) worked fine. With this change, Firefox also works without issues.
1 parent a520ddb commit e4c67d7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/assets/javascripts/editor/editor.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,10 @@ var CodeOceanEditor = {
780780
const element = $(initiator);
781781

782782
if (initiator && element) {
783-
$(initiator).closest('[data-bs-toggle="tooltip"]').tooltip('hide');
783+
const tooltipElement = $(initiator).closest('[data-bs-toggle="tooltip"]');
784+
if (typeof tooltipElement.tooltip === 'function') {
785+
tooltipElement.tooltip('hide');
786+
}
784787
$(initiator).find('i.fa-solid, i.fa-regular').hide();
785788
$(initiator).find('i.fa-spin').addClass('d-inline-block').removeClass('d-none');
786789
}

0 commit comments

Comments
 (0)