Cancel changes after exit webhook edit mode [SCI-5964]

This commit is contained in:
aignatov-bio 2021-08-05 12:44:01 +02:00
parent 024f9117e6
commit cfa7937f88
2 changed files with 3 additions and 1 deletions

View file

@ -49,7 +49,9 @@
$('.activity-filters-list').on('click', '.edit-webhook-container .cancel-action', function(e) {
let webhookContainer = $(this).closest('.webhook');
let input = webhookContainer.find('.url-input');
e.preventDefault();
input.val(input.data('original-value'));
webhookContainer.find('.view-mode').removeClass('hidden');
webhookContainer.find('.edit-webhook-container').addClass('hidden');
});

View file

@ -4,7 +4,7 @@
</div>
<span class="form-text"><%= t("webhooks.index.target") %></span>
<div class="sci-input-container url-input-container form-group">
<%= f.text_field :url, class: "sci-input-field url-input", placeholder: t("webhooks.index.url_placeholder") %>
<%= f.text_field :url, class: "sci-input-field url-input", placeholder: t("webhooks.index.url_placeholder"), data: {original_value: f.object.url } %>
</div>
<button class="btn btn-light cancel-action">
<i class="fas fa-times"></i>