META-INF.resources.edit_vocabulary_settings.jspf Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.asset.categories.admin.web
Show all versions of com.liferay.asset.categories.admin.web
Liferay Asset Categories Admin Web
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
*/
--%>
<%
EditVocabularySettingsDisplayContext editVocabularySettingsDisplayContext = new EditVocabularySettingsDisplayContext(request, vocabulary);
long[] selectedClassNameIds = editVocabularySettingsDisplayContext.getSelectedClassNameIds();
long[] selectedClassTypePKs = editVocabularySettingsDisplayContext.getSelectedClassTypePKs();
%>
<%
List indexes = new ArrayList<>();
for (int index = 0; index < selectedClassNameIds.length; index++) {
indexes.add(String.valueOf(index));
long classNameId = selectedClassNameIds[index];
final long classTypePK = selectedClassTypePKs[index];
%>
<%
for (AssetRendererFactory> assetRendererFactory : editVocabularySettingsDisplayContext.getClassTypedAssetRenderFactories()) {
%>
subtype-select">
<%
}
%>
<%
Group scopeGroup = themeDisplay.getScopeGroup();
%>
<%
}
%>
let autoFields = null;
AUI().use('liferay-auto-fields', (A) => {
const extraFields = A.one('# extraFields');
autoFields = new Liferay.AutoFields({
contentBox: '# extraFields',
fieldIndexes: ' indexes',
minimumRows: 1,
namespace: ' ',
on: {
clone: function (event) {
const row = event.row.getDOM();
row.querySelectorAll('.subtype-select').forEach((child) => {
child.classList.add('hide');
});
},
},
}).render();
extraFields.setData('autoFieldsInstance', autoFields);
});
const form = document.getElementById(' fm');
Liferay.Util.delegate(
form,
'change',
'.vocabulary-asset-type-select',
(event) => {
const target = event.delegateTarget;
const row = target.closest('.lfr-form-row');
row.querySelectorAll('.subtype-select').forEach((child) => {
child.classList.add('hide');
});
const select = row.querySelector('[name*=subtype' + target.value + ']');
if (select) {
select.closest('.subtype-select').classList.remove('hide');
}
autoFields.save(A.one('# fm'));
}
);