mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-01 17:38:38 +00:00
Extract Batch Edit controller
This commit is contained in:
parent
e438b5e63f
commit
f7c8466231
4 changed files with 20 additions and 24 deletions
15
assets/controllers/batch_edit_controller.js
Normal file
15
assets/controllers/batch_edit_controller.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = ['item', 'tagAction'];
|
||||
|
||||
toggleSelection(e) {
|
||||
this.itemTargets.forEach((item) => {
|
||||
item.checked = e.currentTarget.checked; // eslint-disable-line no-param-reassign
|
||||
});
|
||||
}
|
||||
|
||||
tagSelection() {
|
||||
this.element.requestSubmit(this.tagActionTarget);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue