Add generic section icon in section picker + clean up legacy section icon stuff
This commit is contained in:
committed by
Sebastiaan Janssen
parent
4cc68912ce
commit
1c554a8770
@@ -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>");
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -1875,3 +1875,6 @@ i.small{
|
||||
.icon-alert-alt:before {
|
||||
content: "\e25d";
|
||||
}
|
||||
.icon-section:before {
|
||||
content: "\e24f";
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
|
||||
function setSectionIcon(sections) {
|
||||
angular.forEach(sections, function(section) {
|
||||
section.icon = "icon-section " + section.cssclass;
|
||||
section.icon = "icon-section";
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@
|
||||
|
||||
function setSectionIcon(sections) {
|
||||
angular.forEach(sections, function (section) {
|
||||
section.icon = "icon-section " + section.cssclass;
|
||||
section.icon = "icon-section";
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user