Skip to content

Commit d12ae77

Browse files
committed
Further TOI improvements
1 parent 2256447 commit d12ae77

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

platform/features/conductor-v2/conductor/res/templates/time-conductor.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
<div class="l-data-visualization">
9292
<mct-include key="'time-of-interest'"
9393
class="l-toi-holder show-val"
94-
ng-class="{ pinned: pinned, 'val-to-left': toi.left > 80 }"
94+
ng-class="{ pinned: toi.pinned, 'val-to-left': toi.left > 80 }"
9595
ng-style="{'left': toi.left + '%'}"></mct-include>
9696
</div>
9797
<a class="l-page-button align-right s-icon-button icon-pointer-right"></a>

platform/features/conductor-v2/conductor/src/ui/ConductorTOIController.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,15 @@ define(
5858

5959
ConductorTOIController.prototype.setOffsetFromBounds = function (bounds) {
6060
var toi = this.conductor.timeOfInterest();
61-
var offset = toi - bounds.start;
62-
var duration = bounds.end - bounds.start;
63-
this.left = offset / duration * 100;
61+
if (toi !== undefined) {
62+
var offset = toi - bounds.start;
63+
var duration = bounds.end - bounds.start;
64+
this.left = offset / duration * 100;
65+
this.pinned = true;
66+
} else {
67+
this.left = 0;
68+
this.pinned = false;
69+
}
6470
};
6571

6672
ConductorTOIController.prototype.changeTimeOfInterest = function () {

platform/features/plot/res/templates/plot.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<mct-include key="'time-of-interest'"
8181
class="l-toi-holder show-val"
8282
ng-if="toiPerc"
83-
ng-class="{ 'val-to-left': toiPerc > 80 }"
83+
ng-class="{ 'pinned': toiPinned, 'val-to-left': toiPerc > 80 }"
8484
ng-style="{'left': toiPerc + '%'}"></mct-include>
8585

8686
<div class="gl-plot-coords"

platform/features/plot/src/PlotController.js

+2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,10 @@ define(
252252
var bounds = conductor.bounds();
253253
var range = bounds.end - bounds.start;
254254
$scope.toiPerc = ((timeOfInterest - bounds.start) / range) * 100;
255+
$scope.toiPinned = true;
255256
} else {
256257
$scope.toiPerc = undefined;
258+
$scope.toiPinned = false;
257259
}
258260
}
259261

platform/features/table/src/controllers/MCTTableController.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ define(
545545

546546
this.$scope.displayRows = this.filterAndSort(newRows || []);
547547
this.resize(newRows).then(this.setVisibleRows)
548-
.then(this.timeout)
548+
.then(this.$timeout)
549549
.then(function() {
550550
var timeOfInterest = this.conductor.timeOfInterest();
551551
if (timeOfInterest) {

0 commit comments

Comments
 (0)