Theme base components refactoring

This commit is contained in:
Pavel Vesely
2020-04-27 16:50:36 +02:00
parent 8523f0d719
commit ced2051704
5 changed files with 193 additions and 151 deletions

View File

@ -8,13 +8,11 @@ namespace Oqtane.Themes.Controls
{
public class MenuBase : ThemeControlBase
{
private List<Page> _menuPages;
protected IEnumerable<Page> MenuPages => _menuPages ?? (_menuPages = GetMenuPages().ToList());
protected IEnumerable<Page> MenuPages => GetMenuPages().ToList();
protected string GetTarget(Page page)
{
return page.Url.StartsWith("http") ? "_new" : string.Empty;
return page.Url != null && page.Url.StartsWith("http") ? "_new" : string.Empty;
}
protected string GetUrl(Page page)