[Windowing] View

Includes the view using the
.search().view to find
the view key and append that to the
end of the url. Prints this out using
the alert window. WTD-16.
This commit is contained in:
Shivam Dave 2015-06-23 11:38:01 -07:00
parent e38ad7b082
commit e55cd88d38
2 changed files with 8 additions and 4 deletions

View File

@ -96,7 +96,7 @@
"implementation": "windowing/NewTabAction.js",
"description": "Open this object in a new tab",
"category": ["view-control", "contextual"],
"depends": [ "$window", "navigationService" ],
"depends": [ "$window", "$route", "$location", "navigationService" ],
"group": "windowing",
"glyph": "y"
},

View File

@ -28,7 +28,8 @@ define(
[],
function () {
"use strict";
var ROOT_ID = "ROOT",
DEFAULT_PATH = "mine";
/**
* The new tab action allows a domain object to be opened
* into a new browser tab. (Currently this is a stub, present
@ -36,7 +37,7 @@ define(
* the user interface.)
* @constructor
*/
function NewTabAction($window, navigationService) {
function NewTabAction($window, $route, $location, navigationService) {
function getNavigatedObject() {
var navigatedObject = navigationService.getNavigation();
return navigatedObject;
@ -47,6 +48,8 @@ define(
* Open the object in a new tab
*/
perform: function () {
var currentDomainObject = getNavigatedObject(),
context = currentDomainObject &&
currentDomainObject.getCapability('context'),
@ -54,7 +57,8 @@ define(
ids = objectPath.map(function (currentDomainObject) {
return currentDomainObject.getId();
}),
partialPath = "/browse/" + ids.slice(1).join("/");
viewKey = $location.search().view,
partialPath = "index.html#/browse/" + ids.slice(1).join("/") + "?view=" + viewKey;
window.alert(partialPath);
}