Refactor tooltip for run button

Even though not reproducible locally, we had some errors captured through Sentry where the Tooltip was opened on the (already hidden) run button. This resulted in an error by the Bootstrap library. Most likely, the issue was caused by some race condition.

Fixes CODEOCEAN-BA
This commit is contained in:
Sebastian Serth
2023-03-14 19:19:06 +01:00
parent a99da79550
commit d015e1536c
2 changed files with 6 additions and 4 deletions

View File

@ -643,7 +643,8 @@ var CodeOceanEditor = {
$('#start-over-active-file').prop('disabled', this.active_frame.data('role') === 'user_defined_file' || this.active_frame.data('read-only') !== undefined);
$('#dummy').toggle(!this.fileActionsAvailable());
$('#render').toggle(this.isActiveFileRenderable());
$('#run').tooltip('hide').toggle(this.isActiveFileRunnable() && !this.running);
$('#run-stop-button-group').tooltip('hide');
$('#run').toggle(this.isActiveFileRunnable() && !this.running);
$('#stop').toggle(this.isActiveFileStoppable());
$('#test').toggle(this.isActiveFileTestable());
},
@ -718,7 +719,7 @@ var CodeOceanEditor = {
},
showSpinner: function (initiator) {
$(initiator).tooltip('hide');
$(initiator).closest('[data-bs-toggle="tooltip"]').tooltip('hide');
$(initiator).find('i.fa-solid, i.fa-regular').hide();
$(initiator).find('i.fa-spin').addClass('d-inline-block').removeClass('d-none');
},