From 985447a4be846516737972af020d712a53919a58 Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle Date: Wed, 6 Oct 2021 10:52:04 +0200 Subject: [PATCH 1/2] Update blocklist.blockconfiguration.overlay.controller.js --- ...t.blockconfiguration.overlay.controller.js | 47 ++++++++++--------- 1 file changed, 25 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..e3039732358c 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,29 @@ }; 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, + section: "settings", + treeAlias: "staticFiles", + entityType: "file", + 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.treePicker(filePicker); - }); + }); }; vm.requestRemoveStylesheetForBlock = function(block) { @@ -251,7 +254,7 @@ vm.addThumbnailForBlock = function(block) { localizationService.localize("blockEditor_headlineAddThumbnail").then(localizedTitle => { - + let allowedFileExtensions = ['jpg', 'jpeg', 'png', 'svg', 'webp', 'gif']; const thumbnailPicker = { @@ -269,7 +272,7 @@ }, close: () => editorService.close() }; - + editorService.staticFilePicker(thumbnailPicker); }); From 9d05d27cb3098926c9ba1f193daf410200eef176 Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle Date: Wed, 6 Oct 2021 14:00:16 +0200 Subject: [PATCH 2/2] Removed obsolete property sets, and switched to staticfilePicker Signed-off-by: Nikolaj Geisle --- .../blocklist.blockconfiguration.overlay.controller.js | 5 +---- 1 file changed, 1 insertion(+), 4 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 e3039732358c..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 @@ -211,9 +211,6 @@ const filePicker = { title: localizedTitle, isDialog: true, - section: "settings", - treeAlias: "staticFiles", - entityType: "file", filter: i => { return !(i.name.indexOf(".css") !== -1); }, @@ -226,7 +223,7 @@ close: () => editorService.close() }; - editorService.treePicker(filePicker); + editorService.staticFilePicker(filePicker); }); };