mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-18 04:20:50 +01:00
Aggiunta informazione dei caratteri digitati per le textarea
This commit is contained in:
parent
47aad6e26c
commit
f1215cf411
@ -103,8 +103,14 @@ Input.prototype.init = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Inizializzazione per textarea
|
// Inizializzazione per textarea
|
||||||
else if (this.element.hasClass('autosize')) {
|
else if (this.element.hasClass('autosize') || htmlElement.hasAttribute('maxlength')) {
|
||||||
|
|
||||||
|
if (this.element.hasClass('autosize'))
|
||||||
initCompleted = initTextareaInput(htmlElement);
|
initCompleted = initTextareaInput(htmlElement);
|
||||||
|
|
||||||
|
if (htmlElement.hasAttribute('maxlength'))
|
||||||
|
initCompleted = initCharsCounter(htmlElement);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inizializzazione per select
|
// Inizializzazione per select
|
||||||
|
@ -26,6 +26,24 @@ function initTextareaInput(input) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initCharsCounter(input) {
|
||||||
|
let $input = $(input);
|
||||||
|
|
||||||
|
$input.maxlength({
|
||||||
|
warningClass: "label label-info",
|
||||||
|
limitReachedClass: "label label-warning",
|
||||||
|
preText: 'usati ',
|
||||||
|
separator: ' di ',
|
||||||
|
postText: ' caratteri.',
|
||||||
|
showMaxLength: false,
|
||||||
|
placement: 'bottom-right-inside',
|
||||||
|
utf8: true,
|
||||||
|
appendToParent: true
|
||||||
|
});
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
function waitCKEditor(input) {
|
function waitCKEditor(input) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
initEditorInput(input);
|
initEditorInput(input);
|
||||||
|
@ -115,6 +115,7 @@ const JS = gulp.parallel(() => {
|
|||||||
'datatables.net-bs/js/dataTables.bootstrap.js',
|
'datatables.net-bs/js/dataTables.bootstrap.js',
|
||||||
'datatables.net-buttons-bs/js/buttons.bootstrap.js',
|
'datatables.net-buttons-bs/js/buttons.bootstrap.js',
|
||||||
'smartwizard/dist/js/jquery.smartWizard.min.js',
|
'smartwizard/dist/js/jquery.smartWizard.min.js',
|
||||||
|
'bootstrap-maxlength/dist/bootstrap-maxlength.js',
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const i in vendor) {
|
for (const i in vendor) {
|
||||||
|
@ -672,7 +672,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
{[ "type": "textarea", "label": "<?php echo tr('Note'); ?>", "name": "note", "value": "$note$" ]}
|
{[ "type": "textarea", "label": "<?php echo tr('Note'); ?>", "name": "note", "value": "$note$", "maxlength": 255 ]}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
"bootstrap": "^3.3.7",
|
"bootstrap": "^3.3.7",
|
||||||
"bootstrap-colorpicker": "2.5.1",
|
"bootstrap-colorpicker": "2.5.1",
|
||||||
"bootstrap-daterangepicker": "^2.1.25",
|
"bootstrap-daterangepicker": "^2.1.25",
|
||||||
|
"bootstrap-maxlength": "1.10.0",
|
||||||
"chart.js": "^2.7.0",
|
"chart.js": "^2.7.0",
|
||||||
"ckeditor4-dev": "^4.14.1",
|
"ckeditor4-dev": "^4.14.1",
|
||||||
"components-jqueryui": "^1.12.1",
|
"components-jqueryui": "^1.12.1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user