ui: unify dropdown width

Fix a nasty scroll bar bug with alias proto selector, style
and adjust all manual widths accordingly.  For a strange reason
the text inputs are 2px shorter in the base forms than the modals
and the static pages so adjust the width to 346 in that case.
This commit is contained in:
Franco Fichtner 2023-11-16 11:29:16 +01:00
parent 2a58142ddb
commit 8b378cd4e7
7 changed files with 16 additions and 10 deletions

View File

@ -33,6 +33,10 @@
}
}
.dropdown-fixup {
overflow-x: hidden !important;
}
.alias_table {
background-color: transparent !important;
}
@ -333,6 +337,8 @@
case 'geoip':
$("#alias_type_geoip").show();
$("#alias\\.proto").selectpicker('show');
/* work around JS injection of nasty overflow scroll bar being injected */
$("#row_alias\\.type > td > .dropdown:last > .dropdown-menu > .inner").addClass('dropdown-fixup');
break;
case 'asn':
$("#alias_type_default").show();
@ -766,8 +772,8 @@
</div>
</td>
<td>
<select id="alias.type" class="selectpicker" data-width="200px"></select>
<select id="alias.proto" multiple="multiple" title="" class="selectpicker" data-width="110px"></select>
<select id="alias.type" class="selectpicker" data-width="245px"></select>
<select id="alias.proto" multiple="multiple" title="{{lang._('None')}}" class="selectpicker" data-width="100px"></select>
</td>
<td>
<span class="help-block" id="help_block_alias.type"></span>
@ -781,7 +787,7 @@
</div>
</td>
<td>
<select id="alias.categories" multiple="multiple" class="tokenize"></select>
<select id="alias.categories" multiple="multiple" class="tokenize" data-width="348px"></select>
<span class="hidden" data-for="help_for_alias.categories">
{{lang._('For grouping purposes you may select multiple groups here to organize items.')}}
</span>
@ -835,7 +841,7 @@
<select multiple="multiple"
id="alias.content"
class="tokenize"
data-width="334px"
data-width="348px"
data-allownew="true"
data-nbdropdownelements="10"
data-live-search="true"

View File

@ -79,7 +79,7 @@
id="{{ id }}"
class="{{style|default('selectpicker')}}"
{% if hint|default(false) %}data-hint="{{hint}}"{% endif %}
data-width="{{width|default("334px")}}"
data-width="{{width|default("346px")}}"
data-allownew="{{allownew|default("false")}}"
data-sortable="{{sortable|default("false")}}"
data-live-search="true"

View File

@ -422,7 +422,7 @@ include("head.inc");
<tr>
<td><a id="help_for_category" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Category"); ?></td>
<td>
<select name="category[]" id="category" multiple="multiple" class="tokenize" data-allownew="true" data-width="334px" data-live-search="true">
<select name="category[]" id="category" multiple="multiple" class="tokenize" data-allownew="true" data-width="348px" data-live-search="true">
<?php
foreach ((new OPNsense\Firewall\Category())->iterateCategories() as $category):
$catname = htmlspecialchars($category['name'], ENT_QUOTES | ENT_HTML401);?>

View File

@ -995,7 +995,7 @@ $( document ).ready(function() {
<tr>
<td><a id="help_for_category" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Category"); ?></td>
<td>
<select name="category[]" id="category" multiple="multiple" class="tokenize" data-allownew="true" data-width="334px" data-live-search="true">
<select name="category[]" id="category" multiple="multiple" class="tokenize" data-allownew="true" data-width="348px" data-live-search="true">
<?php
foreach ((new OPNsense\Firewall\Category())->iterateCategories() as $category):
$catname = htmlspecialchars($category['name'], ENT_QUOTES | ENT_HTML401);?>

View File

@ -234,7 +234,7 @@ $( document ).ready(function() {
<tr>
<td><a id="help_for_category" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Category"); ?></td>
<td>
<select name="category[]" id="category" multiple="multiple" class="tokenize" data-allownew="true" data-width="334px" data-live-search="true">
<select name="category[]" id="category" multiple="multiple" class="tokenize" data-allownew="true" data-width="348px" data-live-search="true">
<?php
foreach ((new OPNsense\Firewall\Category())->iterateCategories() as $category):
$catname = htmlspecialchars($category['name'], ENT_QUOTES | ENT_HTML401);?>

View File

@ -815,7 +815,7 @@ include("head.inc");
<tr>
<td><a id="help_for_category" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Category"); ?></td>
<td>
<select name="category[]" id="category" multiple="multiple" class="tokenize" data-allownew="true" data-width="334px" data-live-search="true">
<select name="category[]" id="category" multiple="multiple" class="tokenize" data-allownew="true" data-width="348px" data-live-search="true">
<?php
foreach ((new OPNsense\Firewall\Category())->iterateCategories() as $category):
$catname = htmlspecialchars($category['name'], ENT_QUOTES | ENT_HTML401);?>

View File

@ -1306,7 +1306,7 @@ include("head.inc");
<tr>
<td><a id="help_for_category" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Category"); ?></td>
<td>
<select name="category[]" id="category" multiple="multiple" class="tokenize" data-allownew="true" data-sortable="false" data-width="334px" data-live-search="true">
<select name="category[]" id="category" multiple="multiple" class="tokenize" data-allownew="true" data-sortable="false" data-width="348px" data-live-search="true">
<?php
foreach ((new OPNsense\Firewall\Category())->iterateCategories() as $category):
$catname = htmlspecialchars($category['name'], ENT_QUOTES | ENT_HTML401);?>