All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.view.jsp Maven / Gradle / Ivy

The newest version!
<%--
/**
 * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
 * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
 */
--%>

<%@ include file="/init.jsp" %>


	
		
			
		

		
			
			

			
				
			

			
				
			
		

		
			Liferay.Util.delegate(
				document.getElementById('fm'),
				'change',
				'input[type=checkbox]',
				(event) => {
					var toggle = event.delegateTarget;

					var disableOnChecked =
						toggle.dataset.disableonchecked === undefined ||
						toggle.dataset.disableonchecked === 'true';
					var inputs = document.querySelectorAll(toggle.dataset.inputselector);

					for (var i = 0; i < inputs.length; i++) {
						var input = inputs[i];

						input.disabled = disableOnChecked
							? toggle.checked
							: !toggle.checked;

						if (!input.disabled) {
							input.classList.remove('disabled');

							if (input.labels && input.labels.length > 0) {
								input.labels[0].classList.remove('disabled');
							}
						}
						else {
							if (input.labels && input.labels.length > 0) {
								input.labels[0].classList.add('disabled');
							}
						}
					}
				}
			);
		
	
	
		
	




© 2015 - 2024 Weber Informatics LLC | Privacy Policy