mirror of
https://codeberg.org/aryak/mozhi
synced 2025-06-04 00:41:07 +05:30
searchable select if js is enabled
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="referrer" content="no-referrer" />
|
||||
<script src="/js/nice-select2.js"></script>
|
||||
<link rel="stylesheet" href="/css/nice-select2.css">
|
||||
<link rel="stylesheet" href="/css/style.css" />
|
||||
</head>
|
||||
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
<div class="wrap languages">
|
||||
<div class="language">
|
||||
<select name="from" aria-label="Source language">
|
||||
<select name="from" aria-label="Source language" id="sourceLanguage">
|
||||
{{range $key, $value := .SourceLanguages}} {{if $.From}}
|
||||
<option value="{{ .Id }}" {{if eq $.From .Id}}selected{{end}}>
|
||||
{{ .Name }}
|
||||
@@ -44,7 +44,7 @@
|
||||
</div>
|
||||
|
||||
<div class="language">
|
||||
<select name="to" aria-label="Target language">
|
||||
<select name="to" aria-label="Target language" id="targetLanguage">
|
||||
{{range $key, $value := .TargetLanguages}}
|
||||
<option value="{{ .Id }}" {{if eq $.To .Id}}selected{{end}}>
|
||||
{{ .Name }}
|
||||
@@ -107,6 +107,10 @@
|
||||
document.getElementById("translation-form").submit();
|
||||
}
|
||||
});
|
||||
var options = { searchable: true };
|
||||
NiceSelect.bind(document.getElementById("targetLanguage"), options);
|
||||
var options = { searchable: true };
|
||||
NiceSelect.bind(document.getElementById("sourceLanguage"), options);
|
||||
</script>
|
||||
</main>
|
||||
{{ template "footer" .}}
|
||||
|
Reference in New Issue
Block a user