fix: save preferred project in local storage
This commit is contained in:
@ -84,7 +84,7 @@ templ IssuePage(vmodel IssuePageVModel) {
|
||||
}
|
||||
<div class="columns">
|
||||
<div class="column is-4">
|
||||
<form id="summary-form" action={ common.CurrentURL(ctx) } method="put" hx-disabled-elt="#summary-form textarea, #summary-form select, #summary-form button" hx-indicator="#generation-progress">
|
||||
<form id="summary-form" action={ common.CurrentURL(ctx) } method="put" hx-disabled-elt="#summary-form textarea, #summary-form select, #summary-form button" hx-on:htmx:before-send="savePreferredProject()" hx-indicator="#generation-progress">
|
||||
<h2 class="title is-size-2">Résumé de la demande</h2>
|
||||
@common.FormSelect(
|
||||
vmodel.SummaryForm, "issue-project", "project", "Projet",
|
||||
@ -93,7 +93,6 @@ templ IssuePage(vmodel IssuePageVModel) {
|
||||
"hx-get", string(common.CurrentURL(ctx, common.WithoutValues("project", "*"))),
|
||||
"hx-target", "body",
|
||||
"hx-push-url", "true",
|
||||
"hx-on:htmx:beforeSend", "onProjectChange(event)",
|
||||
),
|
||||
)
|
||||
@common.FormTextarea(
|
||||
@ -142,8 +141,8 @@ templ IssuePage(vmodel IssuePageVModel) {
|
||||
sessionStorage.setItem(`summary-${projectId}`, summary);
|
||||
}
|
||||
|
||||
function onProjectChange(evt) {
|
||||
const projectId = evt.currentTarget.value;
|
||||
function savePreferredProject() {
|
||||
const projectId = document.getElementById("issue-project").value;
|
||||
localStorage.setItem(`preferred-project`, projectId);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user