Skip to content

Commit

Permalink
v9: bugfix 11228 Blocklist stylesheet path includes wwwroot (#11298)
Browse files Browse the repository at this point in the history
* Update blocklist.blockconfiguration.overlay.controller.js

* Removed obsolete property sets, and switched to staticfilePicker

Signed-off-by: Nikolaj Geisle <[email protected]>

Co-authored-by: Nikolaj Geisle <[email protected]>
  • Loading branch information
Zeegaan and Nikolaj Geisle authored Oct 7, 2021
1 parent bef1cce commit 54eeaed
Showing 1 changed file with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
}
]
};

editorService.contentTypePicker(settingsTypePicker);

});
Expand Down Expand Up @@ -179,7 +179,7 @@
},
close: () => editorService.close()
};

editorService.filePicker(filePicker);

});
Expand All @@ -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) {
Expand All @@ -251,7 +251,7 @@
vm.addThumbnailForBlock = function(block) {

localizationService.localize("blockEditor_headlineAddThumbnail").then(localizedTitle => {

let allowedFileExtensions = ['jpg', 'jpeg', 'png', 'svg', 'webp', 'gif'];

const thumbnailPicker = {
Expand All @@ -269,7 +269,7 @@
},
close: () => editorService.close()
};

editorService.staticFilePicker(thumbnailPicker);

});
Expand Down

0 comments on commit 54eeaed

Please sign in to comment.