mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-27 16:36:00 +00:00
Extract Fake Radio controller
This commit is contained in:
parent
a06da68e72
commit
1fd861078d
3 changed files with 16 additions and 21 deletions
13
assets/controllers/fake_radio_controller.js
Normal file
13
assets/controllers/fake_radio_controller.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { Controller } from '@hotwired/stimulus';
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = ['emailTwoFactor', 'googleTwoFactor'];
|
||||
|
||||
uncheckGoogle() {
|
||||
this.googleTwoFactorTarget.checked = false;
|
||||
}
|
||||
|
||||
uncheckEmail() {
|
||||
this.emailTwoFactorTarget.checked = false;
|
||||
}
|
||||
}
|
|
@ -43,24 +43,6 @@ $(document).ready(() => {
|
|||
}
|
||||
};
|
||||
});
|
||||
|
||||
// mimic radio button because emailTwoFactor is a boolean
|
||||
$('#update_user_googleTwoFactor').on('change', () => {
|
||||
$('#update_user_emailTwoFactor').prop('checked', false);
|
||||
});
|
||||
|
||||
$('#update_user_emailTwoFactor').on('change', () => {
|
||||
$('#update_user_googleTwoFactor').prop('checked', false);
|
||||
});
|
||||
|
||||
// same mimic for super admin
|
||||
$('#user_googleTwoFactor').on('change', () => {
|
||||
$('#user_emailTwoFactor').prop('checked', false);
|
||||
});
|
||||
|
||||
$('#user_emailTwoFactor').on('change', () => {
|
||||
$('#user_googleTwoFactor').prop('checked', false);
|
||||
});
|
||||
});
|
||||
|
||||
(function darkTheme() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue