fix: update filter area icons for match types and improve button alignment
This commit is contained in:
parent
ecc6d08262
commit
e26a8e5e53
2 changed files with 11 additions and 3 deletions
|
|
@ -1248,7 +1248,13 @@ class FilterArea {
|
|||
const $input = field.$wrapper.find("input").first();
|
||||
if (!$input.length || $input.closest(".input-group").length) return;
|
||||
|
||||
const getSymbol = (match_type) => (match_type === "=" ? "=" : "≈");
|
||||
const getIcon = (match_type) => {
|
||||
if (match_type === "=") {
|
||||
return frappe.utils.icon("equal");
|
||||
} else {
|
||||
return frappe.utils.icon("equal-approximately");
|
||||
}
|
||||
};
|
||||
|
||||
$input.wrap('<div class="input-group"></div>');
|
||||
const $inputGroup = $input.parent();
|
||||
|
|
@ -1260,7 +1266,7 @@ class FilterArea {
|
|||
data-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
${getSymbol(df.match_type || "≈")}
|
||||
${getIcon(df.match_type || "≈")}
|
||||
|
||||
</button>
|
||||
<ul class="dropdown-menu match-type-dropdown-menu dropdown-menu-right">
|
||||
|
|
@ -1283,7 +1289,7 @@ class FilterArea {
|
|||
if (new_type === current_type) return;
|
||||
|
||||
field.df.match_type = new_type;
|
||||
$dropdown.find("button").html(`${getSymbol(new_type)}`);
|
||||
$dropdown.find("button").html(getIcon(new_type));
|
||||
|
||||
let value = field.get_value?.();
|
||||
if (new_type === "=" && value) {
|
||||
|
|
|
|||
|
|
@ -117,6 +117,8 @@
|
|||
border-bottom-left-radius: 0 !important;
|
||||
height: var(--btn-height);
|
||||
border-left: 1px solid var(--btn-group-border-color);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&:focus {
|
||||
box-shadow: none !important;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue