Skip to content

Commit

Permalink
Merge pull request ngageoint#527 in WV/opensphere from ~BRELSFORDT/op…
Browse files Browse the repository at this point in the history
…ensphere:feature_update-date-control to master

* commit '087171accc59c43a1767d6bf75ec97a733c7889a':
  feat(timeline): Update timeline on most recent menu selection
  • Loading branch information
brelsftm committed Nov 20, 2018
2 parents 4cda61b + 087171a commit 90826c5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/os/layer/vector.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ os.layer.Vector.prototype.callAction = function(type) {
}
}
}
os.ui.timeline.TimelineCtrl.setView();
break;
case os.action.EventType.REFRESH:
if (source instanceof os.source.Request) {
Expand Down
4 changes: 1 addition & 3 deletions src/os/ui/datetime/datecontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,5 @@ os.ui.datetime.DateControlCtrl.prototype.getUIEndDate = function() {
* @private
*/
os.ui.datetime.DateControlCtrl.prototype.onTimelineReset_ = function(event) {
if (!this['disabled']) {
this.update();
}
this.update();
};
14 changes: 14 additions & 0 deletions src/os/ui/timeline/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,20 @@ os.ui.timeline.TimelineCtrl.prototype.brushCollectionChanged_ = function(brushes
};


/**
* Set the timeline view to the load range.
*
*/
os.ui.timeline.TimelineCtrl.setView = function() {
var tlc = os.time.TimelineController.getInstance();
var tlScope = angular.element('.c-svg-timeline').scope();
if (tlScope && tlScope['timeline']) {
var timeline = /** @type {os.ui.timeline.TimelineCtrl} */ (tlScope['timeline']);
timeline.zoomToExtent([tlc.getStart(), tlc.getEnd()]);
}
};


// the timeline should be exempt from right-click prevention
os.events.addExemption(
/**
Expand Down

0 comments on commit 90826c5

Please sign in to comment.