Hide backdrop when closing/select navigation (#10907)
(cherry picked from commit 72d33b8f68)
# Conflicts:
# src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js
# src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js
This commit is contained in:
committed by
Sebastiaan Janssen
parent
2c885f7a86
commit
22c49398e3
@@ -3,7 +3,7 @@
|
||||
* @name umbraco.directives.directive:umbTree
|
||||
* @restrict E
|
||||
**/
|
||||
function umbTreeDirective($q, $rootScope, treeService, notificationsService, userService, backdropService) {
|
||||
function umbTreeDirective($q, treeService, notificationsService) {
|
||||
|
||||
return {
|
||||
restrict: 'E',
|
||||
@@ -318,18 +318,6 @@ function umbTreeDirective($q, $rootScope, treeService, notificationsService, use
|
||||
}
|
||||
}
|
||||
|
||||
// Close any potential backdrop and remove the #leftcolumn modifier class
|
||||
function closeBackdrop() {
|
||||
var aboveClass = 'above-backdrop';
|
||||
var leftColumn = $('#leftcolumn');
|
||||
var isLeftColumnOnTop = leftColumn.hasClass(aboveClass);
|
||||
|
||||
if(isLeftColumnOnTop){
|
||||
backdropService.close();
|
||||
leftColumn.removeClass(aboveClass);
|
||||
}
|
||||
}
|
||||
|
||||
/** Returns the css classses assigned to the node (div element) */
|
||||
$scope.getNodeCssClass = function (node) {
|
||||
if (!node) {
|
||||
@@ -369,8 +357,6 @@ function umbTreeDirective($q, $rootScope, treeService, notificationsService, use
|
||||
defined on the tree
|
||||
*/
|
||||
$scope.select = function (n, ev) {
|
||||
|
||||
closeBackdrop()
|
||||
|
||||
if (n.metaData && n.metaData.noAccess === true) {
|
||||
ev.preventDefault();
|
||||
|
||||
@@ -30,7 +30,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
|
||||
var element = $(args.element);
|
||||
element.addClass('above-backdrop');
|
||||
});
|
||||
|
||||
|
||||
|
||||
//A list of query strings defined that when changed will not cause a reload of the route
|
||||
var nonRoutingQueryStrings = ["mculture", "cculture", "csegment", "lq", "sr"];
|
||||
@@ -118,19 +118,28 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
|
||||
}
|
||||
|
||||
function closeBackdrop() {
|
||||
var aboveClass = 'above-backdrop';
|
||||
var leftColumn = $('#leftcolumn');
|
||||
var isLeftColumnOnTop = leftColumn.hasClass(aboveClass);
|
||||
|
||||
if(isLeftColumnOnTop){
|
||||
backdropService.close();
|
||||
leftColumn.removeClass(aboveClass);
|
||||
var tourIsOpen = document.body.classList.contains("umb-tour-is-visible");
|
||||
if (tourIsOpen) {
|
||||
return;
|
||||
}
|
||||
|
||||
var aboveClass = "above-backdrop";
|
||||
var leftColumn = document.getElementById("leftcolumn");
|
||||
|
||||
if (leftColumn) {
|
||||
var isLeftColumnOnTop = leftColumn.classList.contains(aboveClass);
|
||||
|
||||
if (isLeftColumnOnTop) {
|
||||
backdropService.close();
|
||||
leftColumn.classList.remove(aboveClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function showBackdrop() {
|
||||
var backDropOptions = {
|
||||
'element': $('#leftcolumn')[0]
|
||||
'element': document.getElementById('leftcolumn')
|
||||
};
|
||||
backdropService.open(backDropOptions);
|
||||
}
|
||||
@@ -328,7 +337,7 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
|
||||
appState.setGlobalState("showTray", false);
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name umbraco.services.navigationService#syncTree
|
||||
* @methodOf umbraco.services.navigationService
|
||||
@@ -361,14 +370,14 @@ function navigationService($routeParams, $location, $q, $injector, eventsService
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
/**
|
||||
* @ngdoc method
|
||||
* @name umbraco.services.navigationService#hasTree
|
||||
* @methodOf umbraco.services.navigationService
|
||||
*
|
||||
* @description
|
||||
* Checks if a tree with the given alias exists.
|
||||
*
|
||||
*
|
||||
* @param {String} treeAlias the tree alias to check
|
||||
*/
|
||||
hasTree: function (treeAlias) {
|
||||
|
||||
Reference in New Issue
Block a user