Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nice-select support for selects with over 30 options. #148

Merged
merged 1 commit into from May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions admin/configure.php
Expand Up @@ -172,6 +172,7 @@ function aprspass ($callsign) {
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="pragma" content="no-cache" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/nice-select.min.css?ver=<?php echo $configPistarRelease['Pi-Star']['Version']; ?>" />
<meta http-equiv="Expires" content="0" />
<title><?php echo "$MYCALL"." - ".$lang['digital_voice']." ".$lang['dashboard']." - ".$lang['configuration'];?></title>
<link rel="stylesheet" type="text/css" href="css/pistar-css.php?version=0.95" />
Expand Down Expand Up @@ -5001,6 +5002,17 @@ function resizeIframe(obj) {
<br />
</div>
</div>
<script type="text/javascript" src="/nice-select.min.js"></script>
<script type="text/javascript">
var selectize = document.querySelectorAll('select')
var options = {searchable: true};
selectize.forEach(function(select){
if( select.length > 30 ) {
select.classList.add("small", "selectize");
NiceSelect.bind(select, options);
}
});
</script>
</body>
</html>

Expand All @@ -5015,6 +5027,17 @@ function resizeIframe(obj) {
<br />
</div>
</div>
<script type="text/javascript" src="/nice-select.min.js"></script>
<script type="text/javascript">
var selectize = document.querySelectorAll('select')
var options = {searchable: true};
selectize.forEach(function(select){
if( select.length > 30 ) {
select.classList.add("small", "selectize");
NiceSelect.bind(select, options);
}
});
</script>
</body>
</html>
<?php } ?>
1 change: 1 addition & 0 deletions css/nice-select.min.css

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

10 changes: 10 additions & 0 deletions css/pistar-css.php
Expand Up @@ -410,6 +410,16 @@
}
}

/* nice-select dropdowns */
.nice-select.small, .nice-select-dropdown li.option {
height: 24px !important;
min-height: 24px !important;
line-height: 24px !important;
}
.nice-select.small ul li:nth-of-type(2) {
clear: both;
}

/* Aria CSS Here
[role="checkbox"] {
padding:5px;
Expand Down
12 changes: 12 additions & 0 deletions index.php
Expand Up @@ -50,6 +50,7 @@
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="css/nice-select.min.css?ver=<?php echo $configPistarRelease['Pi-Star']['Version']; ?>" />
<title><?php echo "$MYCALL"." - ".$lang['digital_voice']." ".$lang['dashboard'];?></title>
<?php include_once "config/browserdetect.php"; ?>
<script type="text/javascript" src="/jquery.min.js"></script>
Expand Down Expand Up @@ -339,4 +340,15 @@ function getMMDVMConfigFileContent() {

</div>
</body>
<script type="text/javascript" src="/nice-select.min.js"></script>
<script type="text/javascript">
var selectize = document.querySelectorAll('select')
var options = {searchable: true};
selectize.forEach(function(select){
if( select.length > 30 ) {
select.classList.add("small", "selectize");
NiceSelect.bind(select, options);
}
});
</script>
</html>
1 change: 1 addition & 0 deletions nice-select.min.js

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