diff options
| 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 |
| commit | 9b6182875de760e3c4e5a6843ee56d25e869c4b8 (patch) | |
| tree | 087de46a6b117bbdf588eac7e4f47be515f1e026 /ishtar_common/templates | |
| parent | 5ec3ea872d0b00b210eb2162f11069dcfe7f0e39 (diff) | |
| download | Ishtar-9b6182875de760e3c4e5a6843ee56d25e869c4b8.tar.bz2 Ishtar-9b6182875de760e3c4e5a6843ee56d25e869c4b8.zip | |
Map: performance optimization to manage large dataset
Diffstat (limited to 'ishtar_common/templates')
| -rw-r--r-- | ishtar_common/templates/blocks/DataTables.html | 19 |
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 %} |
