dont zoom on list views
This commit is contained in:
parent
9b80a44d6d
commit
6a9b999e1c
2 changed files with 14 additions and 6 deletions
|
@ -123,6 +123,9 @@ editor = {
|
||||||
geometry_url = geometry_url.attr('data-geometry-url');
|
geometry_url = geometry_url.attr('data-geometry-url');
|
||||||
var highlight_type = content.find('[data-list]');
|
var highlight_type = content.find('[data-list]');
|
||||||
var editing_id = content.find('[data-editing]');
|
var editing_id = content.find('[data-editing]');
|
||||||
|
if (editor._next_zoom === null) {
|
||||||
|
editor._next_zoom = !content.find('[data-nozoom]').length;
|
||||||
|
}
|
||||||
editor.load_geometries(
|
editor.load_geometries(
|
||||||
geometry_url,
|
geometry_url,
|
||||||
(highlight_type.length ? highlight_type.attr('data-list') : null),
|
(highlight_type.length ? highlight_type.attr('data-list') : null),
|
||||||
|
@ -195,6 +198,7 @@ editor = {
|
||||||
_bounds_layer: null,
|
_bounds_layer: null,
|
||||||
_highlight_geometries: {},
|
_highlight_geometries: {},
|
||||||
_creating: false,
|
_creating: false,
|
||||||
|
_next_zoom: true,
|
||||||
init_geometries: function () {
|
init_geometries: function () {
|
||||||
// init geometries and edit listeners
|
// init geometries and edit listeners
|
||||||
editor._highlight_layer = L.layerGroup().addTo(editor.map);
|
editor._highlight_layer = L.layerGroup().addTo(editor.map);
|
||||||
|
@ -259,11 +263,15 @@ editor = {
|
||||||
editor._highlight_layer.addTo(editor.map);
|
editor._highlight_layer.addTo(editor.map);
|
||||||
editor._loading_geometry = false;
|
editor._loading_geometry = false;
|
||||||
if (editor._bounds_layer === null) editor._bounds_layer = editor._geometries_layer;
|
if (editor._bounds_layer === null) editor._bounds_layer = editor._geometries_layer;
|
||||||
editor.map.flyToBounds((editor._bounds_layer.getBounds !== undefined) ? editor._bounds_layer.getBounds() : [editor._bounds_layer.getLatLng(), editor._bounds_layer.getLatLng()], {
|
if (editor._next_zoom) {
|
||||||
maxZoom: 4,
|
editor.map.flyToBounds((editor._bounds_layer.getBounds !== undefined) ? editor._bounds_layer.getBounds() : [editor._bounds_layer.getLatLng(), editor._bounds_layer.getLatLng()], {
|
||||||
duration: 0.5,
|
maxZoom: 4,
|
||||||
padding: [20, 20]
|
duration: 0.5,
|
||||||
});
|
padding: [20, 20]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
editor._next_zoom = null;
|
||||||
|
|
||||||
editor._check_start_editing();
|
editor._check_start_editing();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
{% trans 'Edit' as edit_caption %}
|
{% trans 'Edit' as edit_caption %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<table class="table table-condensed itemtable" data-list="{{ model_name }}">
|
<table class="table table-condensed itemtable" data-nozoom data-list="{{ model_name }}">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in objects %}
|
{% for item in objects %}
|
||||||
{% if forloop.counter0|divisibleby:10 %}
|
{% if forloop.counter0|divisibleby:10 %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue