Skip to content

Commit

Permalink
fix(keymaps): custom mappings not immediately available on save
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmckendry committed Aug 25, 2024
1 parent 69844a5 commit 0b28342
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 11 deletions.
2 changes: 1 addition & 1 deletion views/mappings.templ
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

templ Mappings(user goth.User, mappings []data.Mapping) {
@Modal("Edit key mappings") {
@Modal("Edit key mappings", true) {
<table id="mappings-table">
<thead>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion views/mappings_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions views/modal.templ
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package views

templ Modal(title string) {
templ Modal(title string, reloadOnClose bool) {
<div
id="modal"
_="on closeModal add .closing then wait for animationend then remove me"
if reloadOnClose {
_="on closeModal add .closing then wait for animationend then remove me then go to location.reload()"
} else {
_="on closeModal add .closing then wait for animationend then remove me"
}
>
<div class="modal-underlay" _="on click trigger closeModal"></div>
<div class="modal-content">
Expand Down
21 changes: 18 additions & 3 deletions views/modal_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion views/page.templ
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ templ Page(nav bool, user goth.User) {
}

templ Help() {
@Modal("Default Shortcuts") {
@Modal("Default Shortcuts", false) {
<table id="mappings-table">
<tr>
<th>Key</th>
Expand Down
2 changes: 1 addition & 1 deletion views/page_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion views/settings.templ
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

templ Settings(user goth.User, settings *data.UserSettings) {
@Modal("Settings") {
@Modal("Settings", false) {
<div class="settings-container">
<div class="setting">
<label for="leaderKey">Leader Key</label>
Expand Down
2 changes: 1 addition & 1 deletion views/settings_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b28342

Please sign in to comment.