mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Migrated SMD reel calculator tool logic to stimulus.
This commit is contained in:
parent
cfd9713e5d
commit
1c7c3bf2c5
3 changed files with 123 additions and 91 deletions
16
assets/controllers/elements/preset_input_controller.js
Normal file
16
assets/controllers/elements/preset_input_controller.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import {Controller} from "@hotwired/stimulus";
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = ["input"];
|
||||
|
||||
connect() {
|
||||
if(!this.inputTarget) {
|
||||
throw new Error("Target input not found");
|
||||
}
|
||||
}
|
||||
|
||||
load(event) {
|
||||
//Use the data-value attribute to load the value of our target input
|
||||
this.inputTarget.value = event.target.dataset.value;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue