From 9d4c601bfd517ce5da689abb0056157be8250af5 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 9 Nov 2016 21:48:46 +0100 Subject: Adapt to new permalink management --- static/saclay/css/styles.css | 5 +---- templates/chimere/blocks/map.html | 8 ++++---- templates/chimere/main_map.html | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/static/saclay/css/styles.css b/static/saclay/css/styles.css index 1ab87b2..d2c6e63 100644 --- a/static/saclay/css/styles.css +++ b/static/saclay/css/styles.css @@ -17,7 +17,7 @@ html, h1, h2, } /* light */ -h2, .cloud h4, #layer_selection, #layer_selection h4, #permalink a, +h2, .cloud h4, #layer_selection, #layer_selection h4, #permalink, #chimere_itinerary_panel label, .ui-menu .ui-menu-item a, #submited-window, #welcome .footer a, label, .map_button a, #marker_hover_content, .notice{ color:#929288; @@ -233,9 +233,6 @@ h3.warn{ border-width:1px; border-style:solid; padding:2px 12px; -} - -#permalink a{ font-weight:normal; } diff --git a/templates/chimere/blocks/map.html b/templates/chimere/blocks/map.html index 99880e9..3633146 100644 --- a/templates/chimere/blocks/map.html +++ b/templates/chimere/blocks/map.html @@ -59,6 +59,7 @@ $("#{{map_id}}").show(); {% if single_category %} $(function() {$('#panel').hide()});{% endif %} + var permalink = window.location.hash.substr(1); var chimere_init_options = { {% if MOBILE %}"mobile": true,{% endif %} {% if enable_clustering %}"enable_clustering": true,{% endif %} @@ -69,8 +70,6 @@ $("#{{map_id}}").show(); "popupContentFull": true, "explicit_popup_hide": true, "map_layers": [{{js_map_layers|safe|escape}}], - 'permalink_label': '{%trans "Permalink"%}', - 'permalink_element': document.getElementById('permalink'), 'routing': {{routing}}, {% if dynamic_categories %}'dynamic_categories': true,{% endif %} {% if default_area %}"default_area": new Array({{default_area.upper_left_corner.x}}, {{default_area.upper_left_corner.y}}, {{default_area.lower_right_corner.x}}, {{default_area.lower_right_corner.y}}),{% endif %} @@ -91,7 +90,8 @@ $("#{{map_id}}").show(); {% if p_current_feature %}"display_feature": {{ p_current_feature }},{% endif %} {% if selected_map_layer %}"selected_map_layer": {{selected_map_layer}},{% endif %} "display_feature_detail_callback": display_feature_detail_callback, - "edition_type_is_route": true + "edition_type_is_route": true, + "permalink": permalink } {% if restricted_extent %}{{ restricted_extent }} chimere_init_options["restricted_extent"] = bounds; @@ -141,7 +141,7 @@ $("#{{map_id}}").show(); $("#{{map_id}}").chimere(chimere_init_options); {% if zoom %} - $('#maps').chimere('zoom', {'area':{{zoom}} }); + if (!permalink) $('#maps').chimere('zoom', {'area':{{zoom}} }); {% endif %} // init layer selection diff --git a/templates/chimere/main_map.html b/templates/chimere/main_map.html index 305c0ee..139ad7f 100644 --- a/templates/chimere/main_map.html +++ b/templates/chimere/main_map.html @@ -91,7 +91,7 @@ {% trans "Draw" %} {% endif %} - + {% if simple %} {% display_welcome 0 %} {%else%} -- cgit v1.2.3