From 54eeaedc52759cf414dd9e1b8fcc8ad86da760cd Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> Date: Thu, 7 Oct 2021 15:43:22 +0200 Subject: [PATCH] v9: bugfix 11228 Blocklist stylesheet path includes wwwroot (#11298) * Update blocklist.blockconfiguration.overlay.controller.js * Removed obsolete property sets, and switched to staticfilePicker Signed-off-by: Nikolaj Geisle Co-authored-by: Nikolaj Geisle --- ...t.blockconfiguration.overlay.controller.js | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.controller.js index 60a4b9245a60..9331e4227bc8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/prevalue/blocklist.blockconfiguration.overlay.controller.js @@ -109,7 +109,7 @@ } ] }; - + editorService.contentTypePicker(settingsTypePicker); }); @@ -179,7 +179,7 @@ }, close: () => editorService.close() }; - + editorService.filePicker(filePicker); }); @@ -206,26 +206,26 @@ }; vm.addStylesheetForBlock = function(block) { - localizationService.localize("blockEditor_headlineAddCustomStylesheet").then(localizedTitle => { - - const filePicker = { - title: localizedTitle, - isDialog: true, - filter: i => { - return !(i.name.indexOf(".css") !== -1); - }, - filterCssClass: "not-allowed", - select: node => { - const filepath = decodeURIComponent(node.id.replace(/\+/g, " ")); - block.stylesheet = "~/" + filepath; - editorService.close(); - }, - close: () => editorService.close() - }; + localizationService.localize("blockEditor_headlineAddCustomStylesheet").then(localizedTitle => { + + const filePicker = { + title: localizedTitle, + isDialog: true, + filter: i => { + return !(i.name.indexOf(".css") !== -1); + }, + filterCssClass: "not-allowed", + select: node => { + const filepath = decodeURIComponent(node.id.replace(/\+/g, " ")); + block.stylesheet = "~/" + filepath.replace("wwwroot/", ""); + editorService.close(); + }, + close: () => editorService.close() + }; - editorService.filePicker(filePicker); + editorService.staticFilePicker(filePicker); - }); + }); }; vm.requestRemoveStylesheetForBlock = function(block) { @@ -251,7 +251,7 @@ vm.addThumbnailForBlock = function(block) { localizationService.localize("blockEditor_headlineAddThumbnail").then(localizedTitle => { - + let allowedFileExtensions = ['jpg', 'jpeg', 'png', 'svg', 'webp', 'gif']; const thumbnailPicker = { @@ -269,7 +269,7 @@ }, close: () => editorService.close() }; - + editorService.staticFilePicker(thumbnailPicker); });