Skip to content

Commit

Permalink
Fix disappearing parameters after webhook edit
Browse files Browse the repository at this point in the history
  • Loading branch information
netwolfuk committed Sep 19, 2020
1 parent 6c70dce commit d58183f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ WebHooksPlugin = {
dialog.ajaxError(thing.textContent);
});
if (! isErrored) {
let refreshDone = false;
dialog.close();

// Animate the removal of the webhook table row.
Expand All @@ -107,8 +108,11 @@ WebHooksPlugin = {
.wrapInner('<div />') // Wrap the content in a div, so that the height can be animated.
.children()
.slideUp(function() {
$j(this).closest('tr').remove();
$('systemParams').updateContainer();
if (!refreshDone) {
$j(this).closest('tr').remove();
$('systemParams').updateContainer();
refreshDone = true;
}
});
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ WebHooksPlugin.Parameters = {
'Accept' : 'application/json'
},
success: function (response) {
let refreshDone = false;
dialog.close();
// Animate the removal of the webhook parameter table row.
// Then do the div refresh after the row is gone.
Expand All @@ -356,8 +357,11 @@ WebHooksPlugin.Parameters = {
.wrapInner('<div />') // Wrap the content in a div, so that the height can be animated.
.children()
.slideUp(function() {
$j(this).closest('tr').remove();
$("projectWebhookParametersContainer").refresh();
if (!refreshDone) {
$j(this).closest('tr').remove();
$("projectWebhookParametersContainer").refresh();
refreshDone = true;
}
});
},
error: function (response) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
</c:otherwise>
</c:choose>
ProjectBuilds = data;
$j('.webHookRow').remove();
$j('#webHookTable .webHookRow').remove();
addWebHooksFromJsonCallback();
});
}
Expand Down

0 comments on commit d58183f

Please sign in to comment.