diff --git a/apps/main/templates/create_layer.html b/apps/main/templates/create_layer.html index cf878b1..1669831 100644 --- a/apps/main/templates/create_layer.html +++ b/apps/main/templates/create_layer.html @@ -118,7 +118,8 @@
@@ -533,7 +534,7 @@ } // Функция для создания формы на основе свойств стиля - function createStyleForm(feature, layerName = "0") { + function createStyleForm(feature, layerName = "0", sinlgeLayer = false) { // Список свойств стиля для отображения в форме const styleProperties = Object.keys(DEFAULT_STYLE); const style = feature.get("style") || DEFAULT_STYLE; // Используем стиль из фичи или по умолчанию @@ -553,6 +554,9 @@ tabLink.setAttribute('aria-controls', `layer_${layerName}`) tabLink.ariaSelected = 'false' tabLink.textContent = `Слой ${layerName}` + if (sinlgeLayer) { + tabLink.classList.add("active") + } tabList.appendChild(tabLink) @@ -562,7 +566,10 @@ tabPane.className = 'tab-pane text-left fade' tabPane.id = `layer_${layerName}` tabPane.role = 'tabpanel' - tabPane.ariaLabelledBy = `layer_${layerName}-tab` + tabPane.setAttribute("aria-labelledby", `layer_${layerName}-tab`) + if (sinlgeLayer) { + tabPane.classList.add("active", "show") + } const row = document.createElement('div') row.className = 'row' @@ -655,7 +662,8 @@ } if (features.length > 0) { const firstFeature = features[0]; - createStyleForm(firstFeature, firstFeature.get('layer')); + console.log(firstFeature, firstFeature.get('layer')) + createStyleForm(firstFeature, firstFeature.get('layer'), true); } }