refactor(js): use autosubmit controller in notified_toggle_component
This commit is contained in:
parent
88866d0413
commit
5d7284b8da
2 changed files with 2 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
= form_tag update_sort_instructeur_procedure_path(procedure_id: @procedure.id, table: 'notifications', column: 'notifications', order: opposite_order), method: 'GET', data: {controller: 'checkbox'} do
|
||||
= form_tag update_sort_instructeur_procedure_path(procedure_id: @procedure.id, table: 'notifications', column: 'notifications', order: opposite_order), method: :get, data: { controller: 'autosubmit' } do
|
||||
.fr-toggle
|
||||
= check_box_tag :order, opposite_order, active?, data: {action: 'change->checkbox#onChange'}, class: 'fr-toggle__input'
|
||||
= check_box_tag :order, opposite_order, active?, class: 'fr-toggle__input'
|
||||
= label_tag :order, t('.show_notified_first'), class: 'fr-toggle__label fr-pl-1w'
|
||||
= submit_tag t('.show_notified_first'), data: {"checkbox-target": 'submit' }, class: 'visually-hidden'
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
import { ApplicationController } from './application_controller';
|
||||
|
||||
export class CheckboxController extends ApplicationController {
|
||||
onChange() {
|
||||
const form = this.element as HTMLFormElement;
|
||||
form.requestSubmit();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue