- trop de trucs d'un coup... je vais faire attention ensuite ^^'
This commit is contained in:
24
assets/controllers/table_controller.js
Normal file
24
assets/controllers/table_controller.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import {Controller} from '@hotwired/stimulus';
|
||||
|
||||
/*
|
||||
* The following line makes this controller "lazy": it won't be downloaded until needed
|
||||
* See https://github.com/symfony/stimulus-bridge#lazy-controllers
|
||||
*/
|
||||
/* stimulusFetch: 'lazy' */
|
||||
export default class extends Controller {
|
||||
static targets = ['body']
|
||||
|
||||
// ...
|
||||
collapse(event) {
|
||||
if (this.bodyTarget.style.display === "none") {
|
||||
this.bodyTarget.style.display = "block";
|
||||
event.currentTarget.classList.remove('fa-chevron-up');
|
||||
event.currentTarget.classList.add('fa-chevron-down');
|
||||
} else {
|
||||
this.bodyTarget.style.display = "none";
|
||||
event.currentTarget.classList.remove('fa-chevron-down');
|
||||
event.currentTarget.classList.add('fa-chevron-up');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user