Skip to content

Commit

Permalink
Fixes for timeline: event pane toggle button was at wrong position in…
Browse files Browse the repository at this point in the history
… IE.

Boolean timelineVisible in MapService did not respect the Dashboard.showTimeline property. Moved checks whether timeline should be visible to DashboardCtrl.
  • Loading branch information
Rinze authored and Rinze committed Oct 20, 2015
1 parent 24b576e commit 772ea42
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
16 changes: 16 additions & 0 deletions csComp/directives/DashboardDirectives/Dashboard/DashboardCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ module Dashboard {
}
});

this.$messageBusService.subscribe('expertMode', (title: string, expertMode: csComp.Services.Expertise) => {
if (title !== 'newExpertise') return;
//Check whether timeline should be visible. Only when at least Intermediate expertise AND dashboard.showTimeline !== false
setTimeout(() => {
if (this.project && this.project.activeDashboard) {
var ad = this.project.activeDashboard;
if (this.$mapService.isIntermediate && (!ad.hasOwnProperty('showTimeline') || ad.showTimeline === true)) {
this.$messageBusService.publish('timeline', 'isEnabled', true);
}
else {
this.$messageBusService.publish('timeline', 'isEnabled', false);
}
}
}, 50);
});

//this.project.activeDashboard.widgets
//this.updateDashboard();
//alert($scope.dashboard.name);
Expand Down
2 changes: 1 addition & 1 deletion csComp/directives/Timeline/Timeline.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</div>
</div>

<div class="timeline-expand-button" style="position:absolute;bottom:{{vm.expandButtonBottom}}px" ng-click="vm.expandToggle()" style="pointer-events:auto">
<div class="timeline-expand-button" style="position:absolute;" ng-style="{'bottom':vm.expandButtonBottom + 'px'}" ng-click="vm.expandToggle()" style="pointer-events:auto">
<span ng-show="vm.expanded" class="fa fa-chevron-down" />
<span ng-hide="vm.expanded" class="fa fa-chevron-up" />
events
Expand Down
14 changes: 3 additions & 11 deletions csComp/services/map/MapService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ module csComp.Services {
switch (title) {
case 'isEnabled':
this.timelineVisible = data;
if (this.timelineVisible) {
this.$timeout(() => { this.$messageBusService.publish('timeline', 'loadProjectTimeRange') }, 100);
}
break;
}
});
Expand Down Expand Up @@ -84,17 +87,6 @@ module csComp.Services {
if (title !== 'newExpertise') return;
this.expertMode = expertMode;
this.$localStorageService.set(csComp.Services.MapService.expertModeKey, expertMode); // You first need to set the key
switch (expertMode) {
case Expertise.Intermediate:
case Expertise.Expert:
case Expertise.Admin:
this.timelineVisible = true;
this.$timeout(() => { this.$messageBusService.publish('timeline', 'loadProjectTimeRange') }, 100);
break;
default:
this.timelineVisible = false;
break;
}
});
}

Expand Down

0 comments on commit 772ea42

Please sign in to comment.