From 9b93a8f1abd0fb13e9f670dc7dc2fcb6b3cdc922 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 9 Aug 2021 08:26:22 +0200 Subject: [PATCH 01/10] Bump version to 8.16.0-rc --- src/SolutionInfo.cs | 4 ++-- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 2dac2d8791..56e0376196 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -18,5 +18,5 @@ using System.Resources; [assembly: AssemblyVersion("8.0.0")] // these are FYI and changed automatically -[assembly: AssemblyFileVersion("8.15.1")] -[assembly: AssemblyInformationalVersion("8.15.1")] +[assembly: AssemblyFileVersion("8.16.0")] +[assembly: AssemblyInformationalVersion("8.16.0-rc")] diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 011b7e019f..024ce07c5f 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -348,9 +348,9 @@ False True - 8151 + 8160 / - http://localhost:8151 + http://localhost:8160 False False From 2c885f7a86df0248d4633d1be42654017ec346f3 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 12 Aug 2021 14:30:10 +0200 Subject: [PATCH 02/10] Bump version to 8.14.3 --- src/SolutionInfo.cs | 4 ++-- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 625cbe3fb7..b9bbd54c8e 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -18,5 +18,5 @@ using System.Resources; [assembly: AssemblyVersion("8.0.0")] // these are FYI and changed automatically -[assembly: AssemblyFileVersion("8.14.2")] -[assembly: AssemblyInformationalVersion("8.14.2")] +[assembly: AssemblyFileVersion("8.14.3")] +[assembly: AssemblyInformationalVersion("8.14.3")] diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index ce465c6dc5..95ba9de0ca 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -348,9 +348,9 @@ False True - 8142 + 8143 / - http://localhost:8142 + http://localhost:8143 8131 / http://localhost:8131 From a5ff1830153b22012bbbdf0b8f942d45050d5cb0 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 12 Aug 2021 14:48:15 +0200 Subject: [PATCH 03/10] Bump version to 8.15.2 --- src/SolutionInfo.cs | 4 ++-- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 2dac2d8791..ff286570c3 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -18,5 +18,5 @@ using System.Resources; [assembly: AssemblyVersion("8.0.0")] // these are FYI and changed automatically -[assembly: AssemblyFileVersion("8.15.1")] -[assembly: AssemblyInformationalVersion("8.15.1")] +[assembly: AssemblyFileVersion("8.15.2")] +[assembly: AssemblyInformationalVersion("8.15.2")] diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index ea238d42d1..56ed9483fe 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -348,9 +348,9 @@ False True - 8151 + 8152 / - http://localhost:8151 + http://localhost:8152 False False From 33feb808dd934cd4b1160ea9bd66b7783507d05f Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 12 Aug 2021 14:56:55 +0200 Subject: [PATCH 04/10] Fix version dependencies --- build/NuSpecs/UmbracoCms.nuspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec index a223704617..db34b5e984 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -26,8 +26,8 @@ not want this to happen as the alpha of the next major is, really, the next major already. --> - - + + From 5a47acceda45e4431ef8268a71ced3738b79d96c Mon Sep 17 00:00:00 2001 From: Mole Date: Tue, 17 Aug 2021 14:36:19 +0200 Subject: [PATCH 05/10] Raise SendingContentModel event for each element type in blocklist (#10869) Co-authored-by: Nikolaj --- .../OutgoingEditorModelEventAttribute.cs | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web/WebApi/Filters/OutgoingEditorModelEventAttribute.cs b/src/Umbraco.Web/WebApi/Filters/OutgoingEditorModelEventAttribute.cs index e2a6f155d0..25585ca0cb 100644 --- a/src/Umbraco.Web/WebApi/Filters/OutgoingEditorModelEventAttribute.cs +++ b/src/Umbraco.Web/WebApi/Filters/OutgoingEditorModelEventAttribute.cs @@ -1,10 +1,8 @@ -using System; +using System.Collections; using System.Net.Http; using System.Web.Http.Filters; -using Umbraco.Core; using Umbraco.Web.Composing; using Umbraco.Web.Editors; -using Umbraco.Web.Models.ContentEditing; namespace Umbraco.Web.WebApi.Filters { @@ -23,18 +21,37 @@ namespace Umbraco.Web.WebApi.Filters if (actionExecutedContext.Response.Content is ObjectContent objectContent) { var model = objectContent.Value; - if (model != null) { - var args = new EditorModelEventArgs( - model, - Current.UmbracoContext); - EditorModelEventManager.EmitEvent(actionExecutedContext, args); - objectContent.Value = args.Model; + if (model is IDictionary modelDict) + { + foreach (var entity in modelDict) + { + if (entity is DictionaryEntry entry) + { + var args = CreateArgs(entry.Value); + EditorModelEventManager.EmitEvent(actionExecutedContext, args); + entry.Value = args.Model; + } + } + } + else + { + var args = CreateArgs(model); + EditorModelEventManager.EmitEvent(actionExecutedContext, args); + objectContent.Value = args.Model; + } } } base.OnActionExecuted(actionExecutedContext); } + + private EditorModelEventArgs CreateArgs(object model) + { + return new EditorModelEventArgs( + model, + Current.UmbracoContext); + } } } From f62fbe3327a7de6b4344cce51e8d915cb03dad03 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Tue, 17 Aug 2021 15:06:09 +0100 Subject: [PATCH 06/10] Minor tour update (#10875) --- .../config/BackOfficeTours/getting-started.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI/config/BackOfficeTours/getting-started.json b/src/Umbraco.Web.UI/config/BackOfficeTours/getting-started.json index 75797f78e7..01defd7e10 100644 --- a/src/Umbraco.Web.UI/config/BackOfficeTours/getting-started.json +++ b/src/Umbraco.Web.UI/config/BackOfficeTours/getting-started.json @@ -272,9 +272,9 @@ "view": "nodename" }, { - "element": "[data-element='editor-content'] [data-element='property-welcomeText']", + "element": "[data-element='editor-content'] [data-element='property-welcomeText'] > div", "title": "Add a welcome text", - "content": "

Add content to the Welcome Text field.

If you don't have any ideas here is a start:

I am learning Umbraco. High Five I Rock #H5IR
.

" + "content": "

Add content to the Welcome Text field.

If you don't have any ideas here is a start:

I am learning Umbraco. High Five I Rock #H5IR

" }, { "element": "[data-element='editor-content'] [data-element='button-saveAndPublish']", From ac53b89fe1210e9e0ab2be171ced97aefb2ccd49 Mon Sep 17 00:00:00 2001 From: Mole Date: Wed, 18 Aug 2021 15:51:16 +0200 Subject: [PATCH 07/10] V8: Improve nested content optimization in the backoffice (#10885) * Get all nested content scaffolds in a single post request * Only load alias array and initialize once * Remove old nested content load code * Get the content types within a scope This will drastically reduce the amount of SQL queries, since the same read lock will be used for all operations. * Add comments * Fix typo * Fix typos Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com> --- .../src/common/resources/content.resource.js | 18 +++ .../nestedcontent/nestedcontent.controller.js | 104 +++++++++--------- src/Umbraco.Web/Editors/ContentController.cs | 18 +++ .../ContentEditing/ContentTypesByAliases.cs | 26 +++++ src/Umbraco.Web/Umbraco.Web.csproj | 1 + 5 files changed, 112 insertions(+), 55 deletions(-) create mode 100644 src/Umbraco.Web/Models/ContentEditing/ContentTypesByAliases.cs diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js index a33e85c9a2..e996ef4111 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js @@ -642,6 +642,24 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) { return $q.when(umbDataFormatter.formatContentGetData(result)); }); }, + + getScaffolds: function(parentId, aliases){ + return umbRequestHelper.resourcePromise( + $http.post( + umbRequestHelper.getApiUrl( + "contentApiBaseUrl", + "GetEmptyByAliases"), + { parentId: parentId, contentTypeAliases: aliases } + ), + 'Failed to retrieve data for empty content item aliases ' + aliases.join(", ") + ).then(function(result) { + Object.keys(result).map(function(key){ + result[key] = umbDataFormatter.formatContentGetData(result[key]); + }); + + return $q.when(result); + }); + }, /** * @ngdoc method * @name umbraco.resources.contentResource#getScaffoldByKey diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js index 446fb8c076..64fc40d84d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/nestedcontent/nestedcontent.controller.js @@ -522,10 +522,14 @@ ]; // Initialize - var scaffoldsLoaded = 0; vm.scaffolds = []; - _.each(model.config.contentTypes, function (contentType) { - contentResource.getScaffold(-20, contentType.ncAlias).then(function (scaffold) { + + contentResource.getScaffolds(-20, contentTypeAliases).then(function (scaffolds){ + // Loop through all the content types + _.each(model.config.contentTypes, function (contentType){ + // Get the scaffold from the result + var scaffold = scaffolds[contentType.ncAlias]; + // make sure it's an element type before allowing the user to create new ones if (scaffold.isElement) { // remove all tabs except the specified tab @@ -554,13 +558,10 @@ // Store the scaffold object vm.scaffolds.push(scaffold); } - - scaffoldsLoaded++; - initIfAllScaffoldsHaveLoaded(); - }, function (error) { - scaffoldsLoaded++; - initIfAllScaffoldsHaveLoaded(); }); + + // Initialize once all scaffolds have been loaded + initNestedContent(); }); /** @@ -586,57 +587,50 @@ }); } - var initIfAllScaffoldsHaveLoaded = function () { + var initNestedContent = function () { // Initialize when all scaffolds have loaded - if (model.config.contentTypes.length === scaffoldsLoaded) { - // Because we're loading the scaffolds async one at a time, we need to - // sort them explicitly according to the sort order defined by the data type. - contentTypeAliases = []; - _.each(model.config.contentTypes, function (contentType) { - contentTypeAliases.push(contentType.ncAlias); - }); - vm.scaffolds = $filter("orderBy")(vm.scaffolds, function (s) { - return contentTypeAliases.indexOf(s.contentTypeAlias); - }); + // Sort the scaffold explicitly according to the sort order defined by the data type. + vm.scaffolds = $filter("orderBy")(vm.scaffolds, function (s) { + return contentTypeAliases.indexOf(s.contentTypeAlias); + }); - // Convert stored nodes - if (model.value) { - for (var i = 0; i < model.value.length; i++) { - var item = model.value[i]; - var scaffold = getScaffold(item.ncContentTypeAlias); - if (scaffold == null) { - // No such scaffold - the content type might have been deleted. We need to skip it. - continue; - } - createNode(scaffold, item); + // Convert stored nodes + if (model.value) { + for (var i = 0; i < model.value.length; i++) { + var item = model.value[i]; + var scaffold = getScaffold(item.ncContentTypeAlias); + if (scaffold == null) { + // No such scaffold - the content type might have been deleted. We need to skip it. + continue; } + createNode(scaffold, item); } - - // Enforce min items if we only have one scaffold type - var modelWasChanged = false; - if (vm.nodes.length < vm.minItems && vm.scaffolds.length === 1) { - for (var i = vm.nodes.length; i < model.config.minItems; i++) { - addNode(vm.scaffolds[0].contentTypeAlias); - } - modelWasChanged = true; - } - - // If there is only one item, set it as current node - if (vm.singleMode || (vm.nodes.length === 1 && vm.maxItems === 1)) { - setCurrentNode(vm.nodes[0], false); - } - - validate(); - - vm.inited = true; - - if (modelWasChanged) { - updateModel(); - } - - updatePropertyActionStates(); - checkAbilityToPasteContent(); } + + // Enforce min items if we only have one scaffold type + var modelWasChanged = false; + if (vm.nodes.length < vm.minItems && vm.scaffolds.length === 1) { + for (var i = vm.nodes.length; i < model.config.minItems; i++) { + addNode(vm.scaffolds[0].contentTypeAlias); + } + modelWasChanged = true; + } + + // If there is only one item, set it as current node + if (vm.singleMode || (vm.nodes.length === 1 && vm.maxItems === 1)) { + setCurrentNode(vm.nodes[0], false); + } + + validate(); + + vm.inited = true; + + if (modelWasChanged) { + updateModel(); + } + + updatePropertyActionStates(); + checkAbilityToPasteContent(); } function extendPropertyWithNCData(prop) { diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 8293d1274f..d7f1d81c77 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -364,6 +364,24 @@ namespace Umbraco.Web.Editors return GetEmpty(contentType, parentId); } + /// + /// Gets a dictionary containing empty content items for every alias specified in the contentTypeAliases array in the body of the request. + /// + /// + /// This is a post request in order to support a large amount of aliases without hitting the URL length limit. + /// + /// + /// + [OutgoingEditorModelEvent] + [HttpPost] + public IDictionary GetEmptyByAliases(ContentTypesByAliases contentTypesByAliases) + { + // It's important to do this operation within a scope to reduce the amount of readlock queries. + using var scope = _scopeProvider.CreateScope(autoComplete: true); + var contentTypes = contentTypesByAliases.ContentTypeAliases.Select(alias => Services.ContentTypeService.Get(alias)); + return GetEmpties(contentTypes, contentTypesByAliases.ParentId).ToDictionary(x => x.ContentTypeAlias); + } + /// /// Gets an empty content item for the document type. diff --git a/src/Umbraco.Web/Models/ContentEditing/ContentTypesByAliases.cs b/src/Umbraco.Web/Models/ContentEditing/ContentTypesByAliases.cs new file mode 100644 index 0000000000..dd1185b304 --- /dev/null +++ b/src/Umbraco.Web/Models/ContentEditing/ContentTypesByAliases.cs @@ -0,0 +1,26 @@ +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; + +namespace Umbraco.Web.Models.ContentEditing +{ + /// + /// A model for retrieving multiple content types based on their aliases. + /// + [DataContract(Name = "contentTypes", Namespace = "")] + public class ContentTypesByAliases + { + /// + /// Id of the parent of the content type. + /// + [DataMember(Name = "parentId")] + [Required] + public int ParentId { get; set; } + + /// + /// The alias of every content type to get. + /// + [DataMember(Name = "contentTypeAliases")] + [Required] + public string[] ContentTypeAliases { get; set; } + } +} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 68bcade20c..2340228eae 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -253,6 +253,7 @@ + From d566d42c4b5470607635c985411ae6c0bbcdfe70 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 20 Aug 2021 14:20:46 +0200 Subject: [PATCH 08/10] Remove unintentional change from 15 months ago that causes you to end up in your windows users folder after each build --- build/build.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build/build.ps1 b/build/build.ps1 index 15d455b976..9ff7a097fd 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -553,7 +553,6 @@ # run if (-not $get) { -cd if ($command.Length -eq 0) { $command = @( "Build" ) From 3030269bdef03af05028e709ab920df1b343ce89 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 20 Aug 2021 14:21:22 +0200 Subject: [PATCH 09/10] Create a cloud-specific zip that includes necessary config transforms for cloud --- build/NuSpecs/tools/Web.config.cloud.xdt | 29 ++++++++++++++++++++++++ build/build.ps1 | 9 ++++++++ 2 files changed, 38 insertions(+) create mode 100644 build/NuSpecs/tools/Web.config.cloud.xdt diff --git a/build/NuSpecs/tools/Web.config.cloud.xdt b/build/NuSpecs/tools/Web.config.cloud.xdt new file mode 100644 index 0000000000..988c741126 --- /dev/null +++ b/build/NuSpecs/tools/Web.config.cloud.xdt @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/build.ps1 b/build/build.ps1 index 9ff7a097fd..55ceb774ee 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -91,6 +91,7 @@ { $src = "$($this.SolutionRoot)\src" $log = "$($this.BuildTemp)\belle.log" + Write-Host "Compile Belle" Write-Host "Logging to $log" @@ -352,6 +353,14 @@ "-x!dotless.Core.*" "-x!Content_Types.xml" "-x!*.pdb" ` > $null if (-not $?) { throw "Failed to zip UmbracoCms." } + + Write-Host "Zip cms cloud" + $this.CopyFile("$($this.SolutionRoot)\build\NuSpecs\tools\Web.config.cloud.xdt", "$tmp\WebApp\Web.config.install.xdt") + &$this.BuildEnv.Zip a -r "$out\UmbracoCms.$($this.Version.Semver).Cloud.zip" ` + "$tmp\WebApp\*" ` + "-x!dotless.Core.*" "-x!Content_Types.xml" "-x!*.pdb" ` + > $null + if (-not $?) { throw "Failed to zip UmbracoCms." } }) $ubuild.DefineMethod("PrepareBuild", From 22c49398e39b3d8e7f6d4479a090ad12cfcb1802 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Fri, 20 Aug 2021 15:59:31 +0200 Subject: [PATCH 10/10] Hide backdrop when closing/select navigation (#10907) (cherry picked from commit 72d33b8f6845fb4f3c713dd5f463509235557c52) # 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 --- .../components/tree/umbtree.directive.js | 16 +--------- .../src/common/services/navigation.service.js | 31 ++++++++++++------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js index 7868f79809..a39475f4da 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/tree/umbtree.directive.js @@ -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(); 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 c628e3a5b1..c8553ec02a 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 @@ -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) {