-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into survey-view-testing
- Loading branch information
Showing
7 changed files
with
83 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- Requires #search_tags_input to exist --> | ||
<div class="relative cursor-pointer !w-full border-2 rounded-lg border-green-300 p-2 px-5 m-1 shadow" | ||
id="tag_{{tag['name']}}" hx-post="/tags/create/{{adventure_id}}/{{tag.name}}" hx-target="#tags-list" | ||
hx-swap="outerHTML" _="on click event.stopPropagation() | ||
on htmx:afterRequest | ||
if detail.xhr.status == 200 | ||
remove me | ||
set #tags_dropdown's *display to 'none' | ||
call #search_tags_input's focus() | ||
end | ||
on keyup from #search_tags_input | ||
set v to its value | ||
if not my innerHTML.includes(v.trim()) | ||
set my *display to 'none' | ||
else | ||
set my *display to 'block' | ||
">{{tag["name"]}}</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- Requires #search_tags_input to exist --> | ||
<div id="tags_dropdown" class="dropdown-menu dropdown-blue z-20 min-w-full flex-wrap !border-gray-400" | ||
style="display: none; width: 100%; opacity: 0; border: none; top: 100%; padding: 0px !important; margin: 0px; margin-top: 0.25rem;" | ||
_="on click event.stopPropagation() end | ||
on keyup or focus from #search_tags_input debounced at 500ms | ||
set my *display to 'flex' | ||
transition my *opacity to 1 over 500ms end | ||
"> | ||
{% for tag in tags %} | ||
{{ render_partial('htmx-tags-dropdown-item.html', tag=tag, adventure_id=adventure_id) }} | ||
{% endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters