mirror of
https://github.com/nasa/openmct.git
synced 2025-04-13 22:23:13 +00:00
[Windowing] Path Alert
Alerts user of the current path using an alert window, however the path is partially shown. It is the part of the current path after index.html#. WTD-16.
This commit is contained in:
parent
d5a9019493
commit
e38ad7b082
@ -92,10 +92,11 @@
|
||||
},
|
||||
{
|
||||
"key": "window",
|
||||
"name": "Open in a new tab",
|
||||
"implementation": "windowing/NewTabAction.js",
|
||||
"description": "Open this object in a new tab",
|
||||
"category": "view-control",
|
||||
"depends": [ "$window" ],
|
||||
"category": ["view-control", "contextual"],
|
||||
"depends": [ "$window", "navigationService" ],
|
||||
"group": "windowing",
|
||||
"glyph": "y"
|
||||
},
|
||||
|
@ -36,15 +36,27 @@ define(
|
||||
* the user interface.)
|
||||
* @constructor
|
||||
*/
|
||||
function NewTabAction($window) {
|
||||
function NewTabAction($window, navigationService) {
|
||||
function getNavigatedObject() {
|
||||
var navigatedObject = navigationService.getNavigation();
|
||||
return navigatedObject;
|
||||
}
|
||||
|
||||
return {
|
||||
/**
|
||||
* Open the object in a new tab
|
||||
*/
|
||||
perform: function () {
|
||||
// Places the current Url into a variable
|
||||
// Then the Url is opened using $window
|
||||
$window.open($window.location.href);
|
||||
var currentDomainObject = getNavigatedObject(),
|
||||
context = currentDomainObject &&
|
||||
currentDomainObject.getCapability('context'),
|
||||
objectPath = context ? context.getPath() : [],
|
||||
ids = objectPath.map(function (currentDomainObject) {
|
||||
return currentDomainObject.getId();
|
||||
}),
|
||||
partialPath = "/browse/" + ids.slice(1).join("/");
|
||||
|
||||
window.alert(partialPath);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user