Skip to content

Commit

Permalink
Further TOI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
akhenry committed Oct 19, 2016
1 parent 2256447 commit d12ae77
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<div class="l-data-visualization">
<mct-include key="'time-of-interest'"
class="l-toi-holder show-val"
ng-class="{ pinned: pinned, 'val-to-left': toi.left > 80 }"
ng-class="{ pinned: toi.pinned, 'val-to-left': toi.left > 80 }"
ng-style="{'left': toi.left + '%'}"></mct-include>
</div>
<a class="l-page-button align-right s-icon-button icon-pointer-right"></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ define(

ConductorTOIController.prototype.setOffsetFromBounds = function (bounds) {
var toi = this.conductor.timeOfInterest();
var offset = toi - bounds.start;
var duration = bounds.end - bounds.start;
this.left = offset / duration * 100;
if (toi !== undefined) {
var offset = toi - bounds.start;
var duration = bounds.end - bounds.start;
this.left = offset / duration * 100;
this.pinned = true;
} else {
this.left = 0;
this.pinned = false;
}
};

ConductorTOIController.prototype.changeTimeOfInterest = function () {
Expand Down
2 changes: 1 addition & 1 deletion platform/features/plot/res/templates/plot.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<mct-include key="'time-of-interest'"
class="l-toi-holder show-val"
ng-if="toiPerc"
ng-class="{ 'val-to-left': toiPerc > 80 }"
ng-class="{ 'pinned': toiPinned, 'val-to-left': toiPerc > 80 }"
ng-style="{'left': toiPerc + '%'}"></mct-include>

<div class="gl-plot-coords"
Expand Down
2 changes: 2 additions & 0 deletions platform/features/plot/src/PlotController.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,10 @@ define(
var bounds = conductor.bounds();
var range = bounds.end - bounds.start;
$scope.toiPerc = ((timeOfInterest - bounds.start) / range) * 100;
$scope.toiPinned = true;
} else {
$scope.toiPerc = undefined;
$scope.toiPinned = false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ define(

this.$scope.displayRows = this.filterAndSort(newRows || []);
this.resize(newRows).then(this.setVisibleRows)
.then(this.timeout)
.then(this.$timeout)
.then(function() {
var timeOfInterest = this.conductor.timeOfInterest();
if (timeOfInterest) {
Expand Down

0 comments on commit d12ae77

Please sign in to comment.