Remove use of jQuery on admin config JS (#17206)
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
This commit is contained in:
parent
e2232cd975
commit
63c3229e36
1 changed files with 0 additions and 20 deletions
|
|
@ -1,4 +1,3 @@
|
|||
/* global jQuery */
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
import { adminModal } from '../adminModal';
|
||||
import { displaySnackbar } from '../messageUtilities';
|
||||
|
|
@ -39,25 +38,6 @@ export default class ConfigController extends Controller {
|
|||
|
||||
// GENERAL FUNCTIONS START
|
||||
|
||||
// This is a bit of hack because we have to deal with Bootstrap used inline, jQuery and Stimulus :-/
|
||||
// NOTE: it'd be best to rewrite this as a reusable "toggle" element in Stimulus without using jQuery + Bootstrap
|
||||
toggleAccordionButtonLabel(event) {
|
||||
const $target = jQuery(event.target);
|
||||
const $container = $target.parent();
|
||||
|
||||
const text = $target.text();
|
||||
|
||||
if ($container) {
|
||||
const show = $container.attr('aria-expanded') === 'true';
|
||||
|
||||
if (show) {
|
||||
$target.text(text.replace(/Hide/i, 'Show'));
|
||||
} else {
|
||||
$target.text(text.replace(/Show/i, 'Hide'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
disableTargetField(event) {
|
||||
const targetElementName = event.target.dataset.disableTarget;
|
||||
const targetElement = this[`${targetElementName}Target`];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue