Skip to content

Commit

Permalink
Open all hierarchies when a concept is in multiple schemes. Fixes #765
Browse files Browse the repository at this point in the history
(cherry picked from commit 6f1807a)
  • Loading branch information
osma committed May 15, 2018
1 parent 58056a6 commit 9142e36
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions resource/js/hierarchy.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,14 @@ function createConceptObject(conceptUri, conceptData) {
*/
function attachTopConceptsToSchemes(schemes, currentNode, parentData) {
for (var i = 0; i < schemes.length; i++) {
if (schemes[i].uri === parentData[currentNode.uri].top) {
if (parentData[currentNode.uri].tops.indexOf(schemes[i].uri) != -1) {
if(Object.prototype.toString.call(schemes[i].children) !== '[object Array]' ) {
schemes[i].children = [];
}
schemes[i].children.push(currentNode);
// the hierarchy response contains the parent info before the topConcepts so it's a safe to open the first one without broaders
if (!schemes.opened && !currentNode.broader) {
schemes[i].state = currentNode.state;
schemes.opened = true;
}
}
}
Expand Down

0 comments on commit 9142e36

Please sign in to comment.