* change event listener range, fix jump bug. bug #36519.

This commit is contained in:
Chenjianyu
2023-07-17 11:02:42 +08:00
parent 9c342d9637
commit fae7849fc7
2 changed files with 19 additions and 3 deletions
+2 -2
View File
@@ -22,13 +22,13 @@
justify-content: center;
align-items: center;
background-color: #ffffff;
cursor: pointer;
}
.step > a
{
position: relative;
left: 5px;
cursor: pointer;
}
.step:first-child
@@ -71,12 +71,12 @@
.step.disabled
{
background-color: #ffffff;
cursor: not-allowed;
}
.step.disabled > a
{
color: #c4c4c4;
cursor: not-allowed;
pointer-events: none;
}
@@ -79,6 +79,8 @@
</div>
</div>
<script>
let isPromptDesignDirty = false;
(function()
{
const steps = document.getElementsByClassName('steps')[0];
@@ -112,11 +114,25 @@
step.previousElementSibling.lastElementChild.classList.remove('solid-arrow');
}
});
const link = step.querySelector('a');
if(!link) continue;
link.addEventListener('click', function(e)
{
if(!isPromptDesignDirty) return;
const result = validateForm();
if(!result) {
e.preventDefault();
return;
}
const submitButton = document.getElementById('saveButton');
if(!submitButton) return;
submitButton.click();
})
}
}
})();
let isPromptDesignDirty = false;
(function()
{
const backButton = document.querySelector('.design-steps button:first-child');