Merge branch 'kjac-v8-fix-dont-retain-cculture' into temp8
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<li class="umb-breadcrumbs__ancestor" ng-repeat="ancestor in ancestors">
|
||||
|
||||
<!-- go to node on click -->
|
||||
<a ng-if="!$last && !allowOnOpen" href="#/{{entityType}}/{{entityType}}/edit/{{ancestor.id}}" class="umb-breadcrumbs__ancestor-link" title="{{ancestor.name}}">{{ancestor.name}}</a>
|
||||
<a ng-if="!$last && !allowOnOpen" ng-href="#{{::pathTo(ancestor)}}" ng-click="openPath(ancestor, $event)" class="umb-breadcrumbs__ancestor-link" title="{{ancestor.name}}">{{ancestor.name}}</a>
|
||||
|
||||
<!-- use callback to handle click -->
|
||||
<a ng-if="!$last && allowOnOpen" href="#" ng-click="open(ancestor)" class="umb-breadcrumbs__ancestor-link" title="{{ancestor.name}}" prevent-default>{{ancestor.name}}</a>
|
||||
|
||||
Reference in New Issue
Block a user