fix event issues
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Description</label>
|
||||
<textarea name="description" class="form-control"></textarea>
|
||||
<textarea id="event_description" name="description" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
@@ -108,17 +108,37 @@
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?= $this->section('scripts') ?>
|
||||
<script src="<?= base_url('assets/tinymce/tinymce.min.js') ?>"></script>
|
||||
<script>
|
||||
(function () {
|
||||
const toggle = document.getElementById('add_to_calendar');
|
||||
const recipients = document.getElementById('calendar_recipients');
|
||||
if (!toggle || !recipients) return;
|
||||
const description = document.getElementById('event_description');
|
||||
|
||||
function sync() {
|
||||
recipients.style.display = toggle.checked ? '' : 'none';
|
||||
if (toggle && recipients) {
|
||||
function sync() {
|
||||
recipients.style.display = toggle.checked ? '' : 'none';
|
||||
}
|
||||
toggle.addEventListener('change', sync);
|
||||
sync();
|
||||
}
|
||||
|
||||
if (description && window.tinymce) {
|
||||
tinymce.init({
|
||||
selector: '#event_description',
|
||||
base_url: '<?= base_url('assets/tinymce') ?>',
|
||||
suffix: '.min',
|
||||
license_key: 'gpl',
|
||||
height: 320,
|
||||
menubar: true,
|
||||
branding: false,
|
||||
promotion: false,
|
||||
plugins: 'advlist autolink lists link charmap preview anchor searchreplace visualblocks code fullscreen insertdatetime table help wordcount',
|
||||
toolbar: 'undo redo | blocks | bold italic underline strikethrough forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link table | removeformat | preview code',
|
||||
convert_urls: false,
|
||||
content_style: 'body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; font-size: 14px; }'
|
||||
});
|
||||
}
|
||||
toggle.addEventListener('change', sync);
|
||||
sync();
|
||||
})();
|
||||
</script>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
Reference in New Issue
Block a user