mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 14:47:56 +01:00
Introduce workaround to fix maps with order sequence holes
This commit is contained in:
parent
0a70199f53
commit
22490b4cd7
@ -24,6 +24,7 @@
|
|||||||
<option value="sample5">sample5</option>
|
<option value="sample5">sample5</option>
|
||||||
<option value="sample6">sample6</option>
|
<option value="sample6">sample6</option>
|
||||||
<option value="sample7">sample7</option>
|
<option value="sample7">sample7</option>
|
||||||
|
<option value="sample8">sample8</option>
|
||||||
<option value="img-support">img-support</option>
|
<option value="img-support">img-support</option>
|
||||||
<option value="error-on-load">error-on-load</option>
|
<option value="error-on-load">error-on-load</option>
|
||||||
<option value="complex">complex</option>
|
<option value="complex">complex</option>
|
||||||
|
@ -226,14 +226,6 @@ class XMLSerializerPela implements XMLMindmapSerializer {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param dom
|
|
||||||
* @param mapId
|
|
||||||
* @throws will throw an error if dom is null or undefined
|
|
||||||
* @throws will throw an error if mapId is null or undefined
|
|
||||||
* @throws will throw an error if the document element is not consistent with a wisemap's root
|
|
||||||
* element
|
|
||||||
*/
|
|
||||||
loadFromDom(dom: Document, mapId: string) {
|
loadFromDom(dom: Document, mapId: string) {
|
||||||
$assert(dom, 'dom can not be null');
|
$assert(dom, 'dom can not be null');
|
||||||
$assert(mapId, 'mapId can not be null');
|
$assert(mapId, 'mapId can not be null');
|
||||||
@ -415,6 +407,16 @@ class XMLSerializerPela implements XMLMindmapSerializer {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Workaround: for some reason, some saved maps have holes in the order.
|
||||||
|
topic
|
||||||
|
.getChildren()
|
||||||
|
.forEach((child, index) => {
|
||||||
|
if (child.getOrder() !== index) {
|
||||||
|
child.setOrder(index);
|
||||||
|
console.log('Toppic with order sequence hole. Introducing fix.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return topic;
|
return topic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user