Source
updateCharCount(('maxlength' in obj.options) ? obj.options.maxlength - value.length : value.length);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
(function($) {
'use strict';
function updateProperties(obj, $elm) {
obj.$hidden.prop('disabled', obj.options.disabled ? true : null);
obj.$input
.prop('disabled', obj.options.disabled ? true : null)
.prop('readonly', obj.options.disabled ? null : true)
.prop('title', obj.options.disabled ? '' : obj.options.hint);
obj.$button
.prop('disabled', obj.options.disabled ? true : null)
.prop('title', obj.options.disabled ? '' : obj.options.hint);
$elm
.toggleClass('multilineinput-readonly', (obj.options.readonly && !obj.options.disabled))
.toggleClass('multilineinput-disabled', obj.options.disabled);
}
function setDisabled(e) {
if ($(this)[0] !== e.target) {
return;
}
var obj = e.data,
$elm = $(this);
obj.options.disabled = (e.type === 'disable');
updateProperties(obj, $elm);
}
function setReadOnly(e) {
if ($(this)[0] !== e.target) {
return;
}
var obj = e.data,
$elm = $(this);
obj.options.readonly = (e.type === 'readonly');
updateProperties(obj, $elm);
}
function openModal(e) {
e.preventDefault();
var obj = e.data;
if (obj.options.disabled) {