summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/blocks/DataTables.html
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/templates/blocks/DataTables.html')
-rw-r--r--ishtar_common/templates/blocks/DataTables.html16
1 files changed, 14 insertions, 2 deletions
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 %}