diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbbreadcrumbs.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbbreadcrumbs.directive.js index 61906bbf74..c95af03dab 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbbreadcrumbs.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbbreadcrumbs.directive.js @@ -46,7 +46,7 @@ Use this directive to generate a list of breadcrumbs. (function () { 'use strict'; - function BreadcrumbsDirective() { + function BreadcrumbsDirective($location, navigationService) { function link(scope, el, attr, ctrl) { @@ -58,6 +58,28 @@ Use this directive to generate a list of breadcrumbs. } }; + scope.openPath = function (ancestor, event) { + // targeting a new tab/window? + if (event.ctrlKey || + event.shiftKey || + event.metaKey || // apple + (event.button && event.button === 1) // middle click, >IE9 + everyone else + ) { + // yes, let the link open itself + return; + } + event.stopPropagation(); + event.preventDefault(); + + var path = scope.pathTo(ancestor); + $location.path(path); + navigationService.clearSearch(["cculture"]); + } + + scope.pathTo = function (ancestor) { + return "/" + scope.entityType + "/" + scope.entityType + "/edit/" + ancestor.id; + } + function onInit() { if ("onOpen" in attr) { scope.allowOnOpen = true; diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index d9c505aa23..76fcc2d1d8 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -28,7 +28,7 @@ function navigationService($routeParams, $location, $q, $timeout, $injector, eve //A list of query strings defined that when changed will not cause a reload of the route var nonRoutingQueryStrings = ["mculture", "cculture", "lq"]; - var retainedQueryStrings = ["mculture", "cculture"]; + var retainedQueryStrings = ["mculture"]; function setMode(mode) { diff --git a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-breadcrumbs.html b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-breadcrumbs.html index ee3e3aa1dc..54e599522d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-breadcrumbs.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/editor/umb-breadcrumbs.html @@ -2,7 +2,7 @@