Menu action icons (#12418)
* Fix icon for export member * Add missing start summary tag * Formatting
This commit is contained in:
committed by
GitHub
parent
1422aa196a
commit
9fce9e05c7
@@ -1,4 +1,4 @@
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Extensions;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models.Trees
|
||||
@@ -27,22 +27,24 @@ namespace Umbraco.Cms.Core.Models.Trees
|
||||
/// </summary>
|
||||
public virtual string? AngularServiceMethodName { get; } = null;
|
||||
|
||||
protected ActionMenuItem(string alias, string name) : base(alias, name)
|
||||
protected ActionMenuItem(string alias, string name)
|
||||
: base(alias, name)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
protected ActionMenuItem(string alias, ILocalizedTextService textService) : base(alias, textService)
|
||||
protected ActionMenuItem(string alias, ILocalizedTextService textService)
|
||||
: base(alias, textService)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
//add the current type to the metadata
|
||||
// add the current type to the metadata
|
||||
if (AngularServiceMethodName.IsNullOrWhiteSpace())
|
||||
{
|
||||
//if no method name is supplied we will assume that the menu action is the type name of the current menu class
|
||||
// if no method name is supplied we will assume that the menu action is the type name of the current menu class
|
||||
ExecuteJsMethod($"{AngularServiceName}.{this.GetType().Name}");
|
||||
}
|
||||
else
|
||||
|
||||
@@ -9,9 +9,10 @@ namespace Umbraco.Cms.Core.Models.Trees
|
||||
{
|
||||
public override string AngularServiceName => "umbracoMenuActions";
|
||||
|
||||
public ExportMember(ILocalizedTextService textService) : base("export", textService)
|
||||
public ExportMember(ILocalizedTextService textService)
|
||||
: base("export", textService)
|
||||
{
|
||||
Icon = "download-alt";
|
||||
Icon = "icon-download-alt";
|
||||
UseLegacyIcon = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Umbraco.Cms.Core.Models.Trees
|
||||
{
|
||||
Alias = alias;
|
||||
Name = textService.Localize("actions", Alias);
|
||||
TextDescription = textService.Localize("visuallyHiddenTexts", alias + "_description", Thread.CurrentThread.CurrentUICulture);
|
||||
TextDescription = textService.Localize("visuallyHiddenTexts", alias + "_description", Thread.CurrentThread.CurrentUICulture);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -91,6 +91,7 @@ namespace Umbraco.Cms.Core.Models.Trees
|
||||
[DataMember(Name = "icon")]
|
||||
public string Icon { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used in the UI to indicate whether icons should be prefixed with "icon-".
|
||||
/// If not legacy icon full icon name should be specified.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user