mirror of
https://github.com/nasa/openmct.git
synced 2025-06-19 15:43:48 +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:
@ -92,10 +92,11 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "window",
|
"key": "window",
|
||||||
|
"name": "Open in a new tab",
|
||||||
"implementation": "windowing/NewTabAction.js",
|
"implementation": "windowing/NewTabAction.js",
|
||||||
"description": "Open this object in a new tab",
|
"description": "Open this object in a new tab",
|
||||||
"category": "view-control",
|
"category": ["view-control", "contextual"],
|
||||||
"depends": [ "$window" ],
|
"depends": [ "$window", "navigationService" ],
|
||||||
"group": "windowing",
|
"group": "windowing",
|
||||||
"glyph": "y"
|
"glyph": "y"
|
||||||
},
|
},
|
||||||
|
@ -36,15 +36,27 @@ define(
|
|||||||
* the user interface.)
|
* the user interface.)
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function NewTabAction($window) {
|
function NewTabAction($window, navigationService) {
|
||||||
|
function getNavigatedObject() {
|
||||||
|
var navigatedObject = navigationService.getNavigation();
|
||||||
|
return navigatedObject;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
/**
|
/**
|
||||||
* Open the object in a new tab
|
* Open the object in a new tab
|
||||||
*/
|
*/
|
||||||
perform: function () {
|
perform: function () {
|
||||||
// Places the current Url into a variable
|
var currentDomainObject = getNavigatedObject(),
|
||||||
// Then the Url is opened using $window
|
context = currentDomainObject &&
|
||||||
$window.open($window.location.href);
|
currentDomainObject.getCapability('context'),
|
||||||
|
objectPath = context ? context.getPath() : [],
|
||||||
|
ids = objectPath.map(function (currentDomainObject) {
|
||||||
|
return currentDomainObject.getId();
|
||||||
|
}),
|
||||||
|
partialPath = "/browse/" + ids.slice(1).join("/");
|
||||||
|
|
||||||
|
window.alert(partialPath);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user