mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-12 19:34:31 +02:00
Hide the second value of constraints based on which operator is selected.
This commit is contained in:
parent
d3a42cd989
commit
b11ef1d60d
2 changed files with 29 additions and 4 deletions
21
assets/controllers/filters/number_constraint_controller.js
Normal file
21
assets/controllers/filters/number_constraint_controller.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
import {Controller} from "@hotwired/stimulus";
|
||||
|
||||
export default class extends Controller {
|
||||
|
||||
static targets = ["operator", "thingsToHide"];
|
||||
|
||||
connect() {
|
||||
this.update();
|
||||
debugger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the visibility state of the value2 input, based on the operator selection.
|
||||
*/
|
||||
update()
|
||||
{
|
||||
for (const thingToHide of this.thingsToHideTargets) {
|
||||
thingToHide.classList.toggle("d-none", this.operatorTarget.value !== "BETWEEN");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue