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

com.liferay.jenkins.results.parser.dependencies.jenkins_report.js Maven / Gradle / Ivy

There is a newer version: 1.0.1492
Show newest version
function setChildStopWatchRowsVisibility(
	childStopWatchRowNames,
	parentRowId,
	show
) {
	if (childStopWatchRowNames == null) {
		return;
	}

	for (var i = 0; i < childStopWatchRowNames.length; i++) {
		var childStopWatchRowElement = document.getElementById(
			parentRowId + '-' + childStopWatchRowNames[i]
		);

		if (childStopWatchRowElement == null) {
			continue;
		}

		if (show) {
			childStopWatchRowElement.style.display = '';
		} else {
			childStopWatchRowElement.style.display = 'none';
		}

		expanderAnchorElement = document.getElementById(
			parentRowId + '-expander-anchor-' + childStopWatchRowNames[i]
		);

		if (
			!show ||
			(show &&
				expanderAnchorElement != null &&
				expanderAnchorElement.text == '- ')
		) {
			var childStopWatchRowsAttribute = childStopWatchRowElement.getAttribute(
				'child-stopwatch-rows'
			);

			if (childStopWatchRowsAttribute != null) {
				setChildStopWatchRowsVisibility(
					childStopWatchRowsAttribute.split(','),
					parentRowId,
					show
				);
			}
		}
	}
}

function toggleStopWatchRecordExpander(parentRowId, parentStopWatchRecordName) {
	var expanderAnchorElement = document.getElementById(
		parentRowId + '-expander-anchor-' + parentStopWatchRecordName
	);

	var row = document.getElementById(
		parentRowId + '-' + parentStopWatchRecordName
	);

	var childStopWatchRowsAttribute = row.getAttribute('child-stopwatch-rows');

	if (expanderAnchorElement.text == '+ ') {
		expanderAnchorElement.text = '- ';

		if (childStopWatchRowsAttribute != null) {
			setChildStopWatchRowsVisibility(
				childStopWatchRowsAttribute.split(','),
				parentRowId,
				true
			);
		}
	} else {
		expanderAnchorElement.text = '+ ';

		if (childStopWatchRowsAttribute != null) {
			setChildStopWatchRowsVisibility(
				childStopWatchRowsAttribute.split(','),
				parentRowId,
				false
			);
		}
	}

	return false;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy