Skip to content

Commit

Permalink
Issue umputun#31: Replace separate UI with the embedded HTMX based
Browse files Browse the repository at this point in the history
   - unified the select element for all browsers
  • Loading branch information
oneils committed Sep 15, 2023
1 parent ce9be2a commit f43711e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/ui/html/pages/home.tmpl.html
Expand Up @@ -78,11 +78,13 @@
{{with .Form.FieldErrors.expUnit}}
<label class='error' style="display: none"></label>
{{end}}
<div class="select-container">
<select name="expUnit">
<option value="m" {{if eq .Form.ExpUnit "s"}}selected{{end}}>minutes</option>
<option value="h" {{if eq .Form.ExpUnit "h"}}selected{{end}}>hours</option>
<option value="d" {{if eq .Form.ExpUnit "d"}}selected{{end}}>days</option>
</select>
</div>
</div>
<div class="exp-errors">
{{with .Form.FieldErrors.exp}}
Expand Down
18 changes: 18 additions & 0 deletions backend/ui/static/css/main.css
Expand Up @@ -75,6 +75,24 @@ select {
padding: 5px 20px 5px 20px;
min-width: 90px;
border-radius: 8px;

-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}

.select-container {position:relative; display: inline;}
.select-container:after {content:""; width:0; height:0; position:absolute; pointer-events: none;}
.select-container:after {
border-left: 5px solid transparent;
border-right: 5px solid transparent;
top: .3em;
right: .75em;
border-top: 8px solid #FFF;
opacity: 0.5;
}
select::-ms-expand {
display: none;
}

.wrapper {
Expand Down

0 comments on commit f43711e

Please sign in to comment.