Merge pull request #1806 from okriuchykhin/ok_SCI_3507

Fix step numbering update on reposition [SCI-3507]
This commit is contained in:
Alex Kriuchykhin 2019-05-29 15:34:45 +02:00 committed by GitHub
commit f68b69ae02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -184,8 +184,8 @@
// Switch position of top and bottom steps
if (!_.isUndefined($stepDown) && !_.isUndefined($stepUp)) {
$stepDown.insertAfter($stepUp);
$stepDown.find(".badge").html(stepDownPosition+1);
$stepUp.find(".badge").html(stepUpPosition+1);
$stepDown.find(".step-number").html(stepDownPosition + 1);
$stepUp.find(".step-number").html(stepUpPosition + 1);
$("html, body").animate({ scrollTop: $step.offset().top - window.innerHeight / 2 });
}
@ -220,7 +220,7 @@
});
}
// Init ajax success/error for edit form
// Init ajax success/error for edit form
function formEditAjax($form) {
$form
.on("ajax:beforeSend", function () {
@ -249,7 +249,7 @@
});
setupAssetsLoading();
})
.on("ajax:error", function(e, xhr, status, error) {
.on("ajax:error", function(e, xhr, status, error) {
$form.renderFormErrors('step', xhr.responseJSON, true, e);
formCallback($form);