Add generic section icon in section picker + clean up legacy section icon stuff

This commit is contained in:
Kenn Jacobsen
2019-02-07 17:14:07 +01:00
committed by Sebastiaan Janssen
parent 4cc68912ce
commit 1c554a8770
6 changed files with 5 additions and 36 deletions

View File

@@ -1,30 +0,0 @@
angular.module("umbraco.directives")
.directive('sectionIcon', function ($compile, iconHelper) {
return {
restrict: 'E',
replace: true,
link: function (scope, element, attrs) {
var icon = attrs.icon;
if (iconHelper.isLegacyIcon(icon)) {
//its a known legacy icon, convert to a new one
element.html("<i class='" + iconHelper.convertFromLegacyIcon(icon) + "'></i>");
}
else if (iconHelper.isFileBasedIcon(icon)) {
var convert = iconHelper.convertFromLegacyImage(icon);
if(convert){
element.html("<i class='icon-section " + convert + "'></i>");
}else{
element.html("<img class='icon-section' src='images/tray/" + icon + "'>");
}
//it's a file, normally legacy so look in the icon tray images
}
else {
//it's normal
element.html("<i class='icon-section " + icon + "'></i>");
}
}
};
});

View File

@@ -1875,3 +1875,6 @@ i.small{
.icon-alert-alt:before {
content: "\e25d";
}
.icon-section:before {
content: "\e24f";
}

View File

@@ -78,7 +78,7 @@
function setSectionIcon(sections) {
angular.forEach(sections, function(section) {
section.icon = "icon-section " + section.cssclass;
section.icon = "icon-section";
});
}

View File

@@ -302,7 +302,7 @@
function setSectionIcon(sections) {
angular.forEach(sections, function (section) {
section.icon = "icon-section " + section.cssclass;
section.icon = "icon-section";
});
}

View File

@@ -11,9 +11,6 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "name")]
public string Name { get; set; }
[DataMember(Name = "cssclass")]
public string Icon { get; set; }
[DataMember(Name = "alias")]
public string Alias { get; set; }

View File

@@ -12,7 +12,6 @@ namespace Umbraco.Web.Models.Mapping
{
CreateMap<ISection, Section>()
.ForMember(dest => dest.RoutePath, opt => opt.Ignore())
.ForMember(dest => dest.Icon, opt => opt.Ignore())
.ForMember(dest => dest.Name, opt => opt.MapFrom(src => textService.Localize("sections/" + src.Alias, (IDictionary<string, string>)null)))
.ReverseMap(); //backwards too!
}