Skip to content

Commit

Permalink
#74 fixes highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderZellober committed Oct 28, 2020
1 parent 1828052 commit 746cdcd
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions app/domain-story-modeler/features/replay/replay.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ function removeHighlights() {
activityDomObject.style.strokeWidth = 1.5;

const { numberBackgroundDom, numberTextDom } = getNumberDomForActivity(activityDomObject);
numberBackgroundDom.style.fill = numberBackgroundColour;
numberTextDom.style.fill = numberColour;
if (numberBackgroundDom && numberTextDom) {
numberBackgroundDom.style.fill = numberBackgroundColour;
numberTextDom.style.fill = numberColour;
}

});

Expand Down Expand Up @@ -277,17 +279,20 @@ function hightlightStep(step) {
activityDomObject.style.strokeWidth = 4;

const { numberBackgroundDom, numberTextDom } = getNumberDomForActivity(activityDomObject);
numberBackgroundDom.style.fill = numberBackgroundHighlightColour;
numberTextDom.style.fill = numberHighlightColour;
if (numberTextDom && numberBackgroundDom) {
numberBackgroundDom.style.fill = numberBackgroundHighlightColour;
numberTextDom.style.fill = numberHighlightColour;
}

});
}
}

function getNumberDomForActivity(activity) {
const numberDOMS = activity.parentElement.getElementsByClassName('djs-labelNumber');
return {
numberBackgroundDom: activity.parentElement.children[1],
numberTextDom: activity.parentElement.children[2]
numberBackgroundDom: numberDOMS[0],
numberTextDom: numberDOMS[1]
};
}

Expand Down

0 comments on commit 746cdcd

Please sign in to comment.