summaryrefslogtreecommitdiff
path: root/ishtar_common/templates/blocks
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-02-05 15:31:51 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-04-24 19:38:56 +0200
commitd3b1234e0ba3dfef4889dd4b1c1f8615231337fe (patch)
tree087de46a6b117bbdf588eac7e4f47be515f1e026 /ishtar_common/templates/blocks
parent18860dd2c4ed4c8a57e6a6eb9b66f9e949f69ee1 (diff)
downloadIshtar-d3b1234e0ba3dfef4889dd4b1c1f8615231337fe.tar.bz2
Ishtar-d3b1234e0ba3dfef4889dd4b1c1f8615231337fe.zip
Map: performance optimization to manage large dataset
Diffstat (limited to 'ishtar_common/templates/blocks')
-rw-r--r--ishtar_common/templates/blocks/DataTables.html19
1 files changed, 12 insertions, 7 deletions
diff --git a/ishtar_common/templates/blocks/DataTables.html b/ishtar_common/templates/blocks/DataTables.html
index f9fba7ba4..3e0faffd0 100644
--- a/ishtar_common/templates/blocks/DataTables.html
+++ b/ishtar_common/templates/blocks/DataTables.html
@@ -79,6 +79,7 @@ gallery_submit_search = function(image_page){
} else {
current_image_page = 1;
}
+ $('.modal-progress').modal('show');
var data = search_get_query_data(query_vars, "{{name}}");
var nb_select = jQuery("#id_{{name}}-length_image").val();
if (!nb_select) nb_select = 10;
@@ -92,16 +93,18 @@ gallery_submit_search = function(image_page){
$("#id_{{name}}-length_image").change(gallery_submit_search);
register_image_gallery(gallery_id);
$('.card[data-toggle="tooltip"]').tooltip();
+ if ($('.modal-progress').length > 0){
+ $('.modal-progress').modal('hide');
+ }
});
-
- if ($('.modal-progress').length > 0){
- $('.modal-progress').modal('hide');
- }
return false;
};
{% endif %}
{% if use_map %}
map_submit_search = function(){
+ var modal_base_text = $('.modal-progress .modal-header').html();
+ $('.modal-progress .modal-header').html("{% trans 'Fetching data...' %}");
+ $('.modal-progress').modal('show');
var data = search_get_query_data(query_vars, "{{name}}");
var nb_select = jQuery("#id_{{name}}-length_map").val();
if (!nb_select) nb_select = 10;
@@ -110,15 +113,17 @@ map_submit_search = function(){
$.getJSON(url, function(data) {
var timestamp = Math.floor(Date.now() / 1000);
var map_id = "map-" + timestamp;
+ $('.modal-progress .modal-header').html("{% trans 'Render map...' %}");
var result = render_map(data, "{{name}}", nb_select, map_id);
$("#tab-content-map-{{name}}").html(result["html"]);
$("#id_{{name}}-length_map").change(map_submit_search);
+ if ($('.modal-progress').length > 0){
+ $('.modal-progress').modal('hide');
+ $('.modal-progress .modal-header').html(modal_base_text);
+ }
register_map(map_id, result["points"]);
});
- if ($('.modal-progress').length > 0){
- $('.modal-progress').modal('hide');
- }
return false;
};
{% endif %}