diff --git a/ihatemoney/templates/edit_project.html b/ihatemoney/templates/edit_project.html index f2fffb20..7fcc725e 100644 --- a/ihatemoney/templates/edit_project.html +++ b/ihatemoney/templates/edit_project.html @@ -2,16 +2,20 @@ {% block js %} - $('#delete-project').click(function(){ - var link = $(this).find('button'); - link.click(function(){ - if ($(this).hasClass("confirm")){ - return true; - } - $(this).html("{{_("Are you sure?")}}"); - $(this).addClass("confirm"); - return false; - }); + let link = $('#delete-project').find('button'); + let deleteOriginalHTML = link.html(); + link.click(function() { + if (link.hasClass("confirm")){ + return true; + } + link.html("{{_("Are you sure?")}}"); + link.addClass("confirm btn-danger"); + return false; + }); + + $('#delete-project').focusout(function() { + link.removeClass("confirm btn-danger"); + link.html(deleteOriginalHTML); }); $('.custom-file-input').on('change', function(event) { diff --git a/ihatemoney/templates/forms.html b/ihatemoney/templates/forms.html index eb3321a0..b17fa14e 100644 --- a/ihatemoney/templates/forms.html +++ b/ihatemoney/templates/forms.html @@ -111,7 +111,7 @@ {{ form.hidden_tag() }} {{ input(form.password) }}
- +
{% endmacro %}