7713 - changing CSS directory breaks RTE (#7726)
This commit is contained in:
@@ -39,8 +39,14 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.RteController",
|
||||
|
||||
stylesheetResource.getAll().then(function(stylesheets){
|
||||
$scope.stylesheets = stylesheets;
|
||||
|
||||
_.each($scope.stylesheets, function (stylesheet) {
|
||||
|
||||
// if the CSS directory changes, previously assigned stylesheets are retained, but will not be visible
|
||||
// and will throw a 404 when loading the RTE. Remove them here. Still needs to be saved...
|
||||
let cssPath = Umbraco.Sys.ServerVariables.umbracoSettings.cssPath;
|
||||
$scope.model.value.stylesheets = $scope.model.value.stylesheets
|
||||
.filter(sheet => sheet.startsWith(cssPath));
|
||||
|
||||
$scope.stylesheets.forEach(stylesheet => {
|
||||
// support both current format (full stylesheet path) and legacy format (stylesheet name only)
|
||||
stylesheet.selected = $scope.model.value.stylesheets.indexOf(stylesheet.path) >= 0 ||$scope.model.value.stylesheets.indexOf(stylesheet.name) >= 0;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user