Skip to content

Commit

Permalink
v 3.0.2
Browse files Browse the repository at this point in the history
fix removing of items.
  • Loading branch information
Maigo Erit committed Jun 17, 2017
1 parent 75eea19 commit a17ae70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Tockler",
"version": "3.0.1",
"version": "3.0.2",
"description": "Automatically track applications usage and working time",
"author": "Maigo Erit <[email protected]>",
"license": "GPL-2.0",
Expand Down
11 changes: 7 additions & 4 deletions src/timeline/timeline-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class TimelineComponent {
this.xScaleMini.domain([timeDomainStart, timeDomainEnd]);
}

addItemsToTimeline(trackItems) {
addItemsToTimeline(trackItems, removeOldValues = false) {
console.log('addItemsToTimeline', trackItems.length);
this.allItems.push(...trackItems);

Expand Down Expand Up @@ -329,16 +329,19 @@ export class TimelineComponent {
return (this.xScaleMini(new Date(d.endDate)) - this.xScaleMini(new Date(d.beginDate)));
});

if (removeOldValues) {
// Remove old elements as needed.
rects.exit().remove();
}

logger.debug("Displaying selected in main");
this.displaySelectedInMain();
}

cleanDataAndAddItemsToTimeline(trackItems) {
console.log('cleanDataAndAddItemsToTimeline');
this.mini.selectAll('.miniItems').remove();
this.main.selectAll('.mainItems').remove();
this.allItems = [];
this.addItemsToTimeline(trackItems);
this.addItemsToTimeline(trackItems, true);
}

displaySelectedInMain() {
Expand Down

0 comments on commit a17ae70

Please sign in to comment.