From 4a1a85bc872b588a22872445099add63d43d3d24 Mon Sep 17 00:00:00 2001 From: Joaquim Nallar Date: Wed, 20 Mar 2024 15:14:07 +0100 Subject: [PATCH] fix: revert fixing current object order in overlays menu (#292) --- CHANGES.md | 1 + mapentity/static/mapentity/mapentity.detail.js | 6 ------ mapentity/static/mapentity/mapentity.forms.js | 4 ---- mapentity/static/mapentity/mapentity.map.js | 4 ---- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3d54fa6f8..81f59f717 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ CHANGELOG - Form clearing not handling number fields - Fix weasyprint html public view by converting file:// schemes with http:// +- Revert fixing current object order in overlays menu (#292) 8.7.2 (2024-03-22) diff --git a/mapentity/static/mapentity/mapentity.detail.js b/mapentity/static/mapentity/mapentity.detail.js index dd2396617..cfedc70e9 100644 --- a/mapentity/static/mapentity/mapentity.detail.js +++ b/mapentity/static/mapentity/mapentity.detail.js @@ -33,12 +33,6 @@ $(document).ready(function () { }); map.layerscontrol.addOverlay(layer, objectsname, verbosename); - // Change the group layer "verbosename" (current object list) in first position - var allOverlaysLayers = document.getElementsByClassName('leaflet-control-layers-overlays')[0]; - if (allOverlaysLayers) { - allOverlaysLayers.insertBefore(allOverlaysLayers.lastChild, allOverlaysLayers.firstChild); - } - // Add object family layer (without current object) map.on('layeradd', function (e) { var options = e.layer.options || { 'modelname': 'None' }; diff --git a/mapentity/static/mapentity/mapentity.forms.js b/mapentity/static/mapentity/mapentity.forms.js index 6212237f4..36241e22b 100644 --- a/mapentity/static/mapentity/mapentity.forms.js +++ b/mapentity/static/mapentity/mapentity.forms.js @@ -73,10 +73,6 @@ MapEntity.GeometryField = L.GeometryField.extend({ var nameHTML = ' ' + objectsname; map.layerscontrol.addOverlay(objectsLayer, nameHTML, tr("Objects")) - // Change the group layer "Objects" (current object list) in first position - var allOverlaysLayers = document.getElementsByClassName('leaflet-control-layers-overlays')[0]; - allOverlaysLayers.insertBefore(allOverlaysLayers.lastChild, allOverlaysLayers.firstChild); - var url = this.modelLayerUrl(); objectsLayer.load(url); }, diff --git a/mapentity/static/mapentity/mapentity.map.js b/mapentity/static/mapentity/mapentity.map.js index 670e70139..20086a9ff 100644 --- a/mapentity/static/mapentity/mapentity.map.js +++ b/mapentity/static/mapentity/mapentity.map.js @@ -348,10 +348,6 @@ $(window).on('entity:map:list', function (e, data) { } ); - // Change the group layer "Objects" (current object list) in first position - var allOverlaysLayers = document.getElementsByClassName('leaflet-control-layers-overlays')[0]; - allOverlaysLayers.insertBefore(allOverlaysLayers.lastChild, allOverlaysLayers.firstChild); - $(window).unload(function () { MapEntity.Context.saveFullContext(map, { filter: '#mainfilter',