Skip to content

Commit

Permalink
use dsfr tooltip instead
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienReuiller committed Jul 22, 2024
1 parent afa7a26 commit 694193f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lemarche/static/js/s3_upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,18 @@ window.s3UploadInit = function s3UploadInit({

const dropzone = new Dropzone(dropzoneSelector, dropzoneConfig);

// Display a help message when the user tries to
// submit the form during file transfer.
submitButton.tooltip({ title: "Veuillez attendre la fin du transfert" });
// Enable it later, during file transfer.
submitButton.tooltip("disable");
// Display a help message when the user tries to submit the form during file transfer.

// Events
dropzone.on("addedfile", function (file) {
submitButton.tooltip("enable");
submitButton.attr("aria-describedby", "tooltip-s3-info");
submitButton.prop("disabled", true);
submitButton.addClass("btn-secondary");
});

// Called when the upload was either successful or erroneous.
dropzone.on("complete", function (file) {
submitButton.tooltip("disable");
submitButton.removeAttr("aria-describedby");
submitButton.prop("disabled", false);
submitButton.removeClass("btn-secondary");
});
Expand All @@ -114,7 +110,7 @@ window.s3UploadInit = function s3UploadInit({
const location = `${formUrl}/${file.upload.filename}`;
// Prevent a selector mistake from being silent.
if ($(callbackLocationSelector).length === 0) {
this._handleUploadError(
this._handleUploadError(
[file],
xhr,
"Ce document n'a pas pu être envoyé à cause d'un problème technique. Nous vous invitons à contacter notre support."
Expand Down
2 changes: 2 additions & 0 deletions lemarche/templates/dashboard/siae_edit_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ <h3 class="fr-callout__title fr-text--sm"><span class="fr-icon-lightbulb-line" a
<ul class="fr-btns-group--right fr-btns-group fr-btns-group--inline">
<li>
{% dsfr_button label="Enregistrer mes modifications" extra_classes="fr-mt-4v" %}
{% comment %}The following tooltip is triggered in s3_upload.js{% endcomment %}
<span class="fr-tooltip fr-placement" id="tooltip-s3-info" role="tooltip" aria-hidden="true">Veuillez attendre la fin du transfert</span>
</li>
</ul>
</div>
Expand Down

0 comments on commit 694193f

Please sign in to comment.