introduce Resource Declaration and Location properties to offer more resource management options for developers
This commit is contained in:
		| @ -32,12 +32,15 @@ namespace Oqtane.Themes | ||||
|                 if (Resources != null && Resources.Exists(item => item.ResourceType == ResourceType.Script)) | ||||
|                 { | ||||
|                     var scripts = new List<object>(); | ||||
|                     foreach (Resource resource in Resources.Where(item => item.ResourceType == ResourceType.Script)) | ||||
|                     foreach (Resource resource in Resources.Where(item => item.ResourceType == ResourceType.Script && item.Declaration != ResourceDeclaration.Global)) | ||||
|                     { | ||||
|                         scripts.Add(new { href = resource.Url, bundle = resource.Bundle ?? "", integrity = resource.Integrity ?? "", crossorigin = resource.CrossOrigin ?? "" }); | ||||
|                     } | ||||
|                     var interop = new Interop(JSRuntime); | ||||
|                     await interop.IncludeScripts(scripts.ToArray()); | ||||
|                     if (scripts.Any()) | ||||
|                     { | ||||
|                         var interop = new Interop(JSRuntime); | ||||
|                         await interop.IncludeScripts(scripts.ToArray()); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Shaun Walker
					Shaun Walker