mirror of
https://github.com/nasa/openmct.git
synced 2025-01-04 12:24:10 +00:00
[Addressability] Expose current view in query param
Expose the currently selected view as a query string parameter, WTD-1149.
This commit is contained in:
parent
fec6f06849
commit
d559dae1e2
@ -47,7 +47,14 @@ define(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateQueryParam(viewKey) {
|
||||||
|
if (viewKey) {
|
||||||
|
$location.search('view', viewKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$scope.$watch('domainObject', setViewForDomainObject);
|
$scope.$watch('domainObject', setViewForDomainObject);
|
||||||
|
$scope.$watch('representation.selected.key', updateQueryParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
return BrowseObjectController;
|
return BrowseObjectController;
|
||||||
|
@ -53,7 +53,7 @@ define(
|
|||||||
|
|
||||||
// Get list of views, read from capability
|
// Get list of views, read from capability
|
||||||
function updateOptions(views) {
|
function updateOptions(views) {
|
||||||
if (Array.isArray(views)) {
|
if (Array.isArray(views) && !($scope.ngModel || {}).selected) {
|
||||||
$timeout(function () {
|
$timeout(function () {
|
||||||
$scope.ngModel.selected = findMatchingOption(
|
$scope.ngModel.selected = findMatchingOption(
|
||||||
views,
|
views,
|
||||||
|
Loading…
Reference in New Issue
Block a user