Skip to content

Commit 7a581c0

Browse files
committed
feat: body section route
1 parent 1e7e4c5 commit 7a581c0

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

assets/script/index.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,41 @@ summary.querySelector('form').onreset = function() {
207207

208208
}
209209

210+
};
211+
212+
213+
body.querySelector('form').onsubmit = function(e) { e.preventDefault();
214+
215+
if (e.submitter.classList.contains('finish')) {
216+
217+
significantChange.querySelector('form').significantChange.parentNode.click();
218+
significantChange.querySelector('form').significantChange.checked = false;
219+
220+
currentTarget = significantChange;
221+
significantChange.scrollIntoView({
222+
behavior: 'smooth'
223+
});
224+
225+
} else {
226+
227+
currentTarget = footer;
228+
footer.scrollIntoView({
229+
behavior: 'smooth'
230+
});
231+
232+
if (type.querySelector('form').type.value == 'revert')
233+
setTimeout(() => footer.querySelector('form button[type="submit"]').click(), 1000);
234+
235+
}
236+
237+
};
238+
body.querySelector('form').onreset = function() {
239+
240+
summary.querySelector('form').summary.parentNode.click();
241+
242+
currentTarget = summary;
243+
summary.scrollIntoView({
244+
behavior: 'smooth'
245+
});
246+
210247
};

0 commit comments

Comments
 (0)