From dfb5da2d29eeb1c9e4b81ea9bc8c883409780bc5 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 4 Nov 2021 21:01:39 +0100 Subject: Syndication - map UI --- ishtar_common/templates/blocks/DataTables.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'ishtar_common/templates/blocks/DataTables.html') diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html index 199cd3af2..2719a9b46 100644 --- a/ishtar_common/templates/blocks/DataTables.html +++ b/ishtar_common/templates/blocks/DataTables.html @@ -67,7 +67,7 @@ $("#tab-gallery-{{name}}").click(function(){ {% if use_map %} $("#tab-map-{{name}}").click(function(){ current_tab = "map"; - map_submit_search(); + map_submit_search(current_source); }); {% endif %} {% if current_model.STATISTIC_MODALITIES %} @@ -91,7 +91,14 @@ gallery_submit_search = function(image_page){ {% endif %} {% if use_map %} map_submit_search = function(){ - return _map_submit_search(query_vars, "{{name}}", "{{source}}"); + if (current_source == "default"){ + return _map_submit_search(query_vars, "{{name}}", "{{source}}"); + } + {% if external_sources %}{% for source_id, source_label, source_url in external_sources %} + else if (current_source == "{{source_id}}"){ + return _map_submit_search(query_vars, "{{name}}", "{{source_url}}", "{{source_id}}"); + } + {% endfor %}{% endif %} }; {% endif %} @@ -160,6 +167,7 @@ update_submit_args = function(){ return false; }; +var current_source = "default"; jQuery(document).ready(function(){ jQuery("#search_{{name}}").click( @@ -169,17 +177,21 @@ jQuery(document).ready(function(){ {% if external_sources %} $("#source_button_default").click( function(){ + current_source = "default"; $(".sources").hide(); $(".sources-default").show(); redraw_plots("{{name}}", "default"); + if (current_tab == "map") map_submit_search(); } ); {% for source_id, source_label, source_url in external_sources %} $("#source_button_{{source_id}}").click( function(){ + current_source = "{{source_id}}"; $(".sources").hide(); $(".sources-{{source_id}}").show(); redraw_plots("{{name}}", "{{source_id}}"); + if (current_tab == "map") map_submit_search(); } ); {% endfor %} -- cgit v1.2.3