1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-16 19:40:44 +01:00

Fix minore

This commit is contained in:
Pek5892 2023-07-19 17:30:38 +02:00
parent 87be1cd6e1
commit db700a4809
3 changed files with 20 additions and 14 deletions

View File

@ -42,24 +42,26 @@ function init() {
});
if ($('form').length) {
$('form').not('.no-check').parsley();
$('form').not('.no-check').parsley();
if (window.CKEDITOR){
CKEDITOR.on('instanceReady', function () {
$('form textarea').each(function () {
if ($(this).attr('obbligatorio') === "1") {
$(this).attr('required', '');
$('form textarea').each(function () {
if ($(this).data('mandatory') === '1') {
$(this).prop('required', true);
}
});
$.each(CKEDITOR.instances, function (instance) {
CKEDITOR.instances[instance].on("change", function (e) {
for (instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
$('form').parsley().validate();
}
});
$.each(CKEDITOR.instances, function (instance) {
CKEDITOR.instances[instance].on("change", function (e) {
for (instance in CKEDITOR.instances) {
CKEDITOR.instances[instance].updateElement();
$('form').parsley().validate();
}
});
});
});
});
}
}
// Aggiunta nell'URL del nome tab su cui tornare dopo il submit

View File

@ -95,6 +95,11 @@ function initCKEditor(input) {
let $input = $(input);
let name = input.getAttribute("id");
if($input.prop('required')){
$input.data('mandatory', '1');
}
// Controllo su istanza già esistente
let instance = CKEDITOR.instances[name];
if (instance) {

View File

@ -226,7 +226,6 @@ echo '
'label' => tr('Richiesta'),
'name' => 'richiesta',
'id' => 'richiesta_add',
'obbligatorio' => 1,
'required' => 1,
'value' => htmlentities($richiesta),
'extra' => 'style=\'max-height:80px;\'',