Commit 66fc5e52 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1556-order-of-icons' into 'devel_16.0.x'

preserver order

See merge request !1357
parents 769087f9 375a3081
Pipeline #47686 passed with stage
in 17 minutes and 6 seconds
...@@ -5,6 +5,8 @@ minerva (16.0.0~beta.3) stable; urgency=medium ...@@ -5,6 +5,8 @@ minerva (16.0.0~beta.3) stable; urgency=medium
(#1557) (#1557)
* Bug fix: issues with exporting map to file or image fixed (#1561, #1560, * Bug fix: issues with exporting map to file or image fixed (#1561, #1560,
#1559) #1559)
* Bug fix: sometimes wrong icn numbers were attached to search results
(#1556)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 27 Sep 2021 08:00:00 +0200 -- Piotr Gawron <piotr.gawron@uni.lu> Mon, 27 Sep 2021 08:00:00 +0200
......
...@@ -1151,8 +1151,10 @@ CustomMap.prototype.fetchIdentifiedElements = function (elements, complete) { ...@@ -1151,8 +1151,10 @@ CustomMap.prototype.fetchIdentifiedElements = function (elements, complete) {
var modelIds = []; var modelIds = [];
var modelElements = []; var modelElements = [];
var i; var i;
var elementPosition = [];
for (i = 0; i < elements.length; i++) { for (i = 0; i < elements.length; i++) {
var element = elements[i]; var element = elements[i];
elementPosition[element.getId()] = i;
if (modelElements[element.getModelId()] === undefined) { if (modelElements[element.getModelId()] === undefined) {
modelIds.push(element.getModelId()); modelIds.push(element.getModelId());
modelElements[element.getModelId()] = []; modelElements[element.getModelId()] = [];
...@@ -1168,7 +1170,10 @@ CustomMap.prototype.fetchIdentifiedElements = function (elements, complete) { ...@@ -1168,7 +1170,10 @@ CustomMap.prototype.fetchIdentifiedElements = function (elements, complete) {
var result = []; var result = [];
return Promise.all(promises).then(function (data) { return Promise.all(promises).then(function (data) {
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
result.push.apply(result, data[i]); data[i].forEach(function (element) {
//preserve the order
result[elementPosition[element.getId()]] = element;
});
} }
return result; return result;
}); });
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment