Skip to content

Commit

Permalink
Increased registration priority for main js/css resources
Browse files Browse the repository at this point in the history
  • Loading branch information
exileDev committed Jan 12, 2022
1 parent 13d59c9 commit 2cbdfc2
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
Expand Up @@ -214,9 +214,6 @@
</div>
</div>

@NopHtml.GenerateScripts(ResourceLocation.Footer)
@NopHtml.GenerateInlineScripts(ResourceLocation.Footer)

<script>
var AdminLTEOptions = {
boxWidgetOptions: {
Expand Down Expand Up @@ -247,5 +244,8 @@
$('[data-toggle="tooltip"]').tooltip({ placement: 'bottom' });
});
</script>

@NopHtml.GenerateScripts(ResourceLocation.Footer)
@NopHtml.GenerateInlineScripts(ResourceLocation.Footer)
</body>
</html>
Expand Up @@ -32,14 +32,14 @@
</div>
</div>

@NopHtml.GenerateScripts(ResourceLocation.Footer)
@NopHtml.GenerateInlineScripts(ResourceLocation.Footer)

<script>
$(document).ready(function () {
//enable tooltips
$('[data-toggle="tooltip"]').tooltip();
});
</script>

@NopHtml.GenerateScripts(ResourceLocation.Footer)
@NopHtml.GenerateInlineScripts(ResourceLocation.Footer)
</body>
</html>
Expand Up @@ -7,11 +7,11 @@
Layout ="";
var themeName = await themeContext.GetWorkingThemeNameAsync();
var supportRtl = await Html.ShouldUseRtlThemeAsync();
var href = $"~/Themes/{themeName}/Content/css/styles{(supportRtl ? ".rtl" : "")}.css";
}

@* add main CSS file *@
<link rel="stylesheet" href="@href" />
//add main CSS file
NopHtml.AppendCssFileParts($"~/Themes/{themeName}/Content/css/styles{(supportRtl ? ".rtl" : "")}.css");

@* add jQuery UI css file *@
<link rel="stylesheet" href="~/lib_npm/jquery-ui-dist/jquery-ui.min.css" />
//add jQuery UI css file
NopHtml.AppendCssFileParts("~/lib_npm/jquery-ui-dist/jquery-ui.min.css");

}
Expand Up @@ -5,6 +5,8 @@
@addTagHelper *, Nop.Web.Framework
@addTagHelper *, MiniProfiler.AspNetCore.Mvc

@inject INopHtmlHelper NopHtml

@using System.Globalization;
@using Microsoft.AspNetCore.Mvc.ViewFeatures
@using Microsoft.Extensions.Primitives
Expand Down
36 changes: 17 additions & 19 deletions src/Presentation/Nop.Web/Views/Shared/_Root.Head.cshtml
Expand Up @@ -12,6 +12,23 @@

@{

NopHtml.AppendScriptParts(ResourceLocation.Footer, "~/js/public.countryselect.js");
NopHtml.AppendScriptParts(ResourceLocation.Footer, "~/js/public.ajaxcart.js");
NopHtml.AppendScriptParts(ResourceLocation.Footer, "~/js/public.common.js");
//when jQuery migrate script logging is active you will see the log in the browser console
if (commonSettings.JqueryMigrateScriptLoggingActive)
{
NopHtml.AppendScriptParts(ResourceLocation.Footer, "~/lib_npm/jquery-migrate/jquery-migrate.js");
}
else
{
NopHtml.AppendScriptParts(ResourceLocation.Footer, "~/lib_npm/jquery-migrate/jquery-migrate.min.js");
}
NopHtml.AppendScriptParts(ResourceLocation.Footer, "~/lib_npm/jquery-ui-dist/jquery-ui.min.js");
NopHtml.AppendScriptParts(ResourceLocation.Footer, "~/lib_npm/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js");
NopHtml.AppendScriptParts(ResourceLocation.Footer, "~/lib_npm/jquery-validation/jquery.validate.min.js");
NopHtml.AppendScriptParts(ResourceLocation.Footer, "~/lib_npm/jquery/jquery.min.js");

//custom tag(s);
if (!string.IsNullOrEmpty(seoSettings.CustomHeadTags))
{
Expand Down Expand Up @@ -55,25 +72,6 @@
<body>
@RenderBody()

<script src="~/lib_npm/jquery/jquery.min.js"></script>
@* when jQuery migrate script logging is active you will see the log in the browser console *@
@if (commonSettings.JqueryMigrateScriptLoggingActive)
{
<script src="~/lib_npm/jquery-migrate/jquery-migrate.js"></script>
}
else
{
<script src="~/lib_npm/jquery-migrate/jquery-migrate.min.js"></script>
}
<script src="~/lib_npm/jquery-ui-dist/jquery-ui.min.js"></script>
<script src="~/lib_npm/jquery-validation/jquery.validate.min.js"></script>
<script src="~/lib_npm/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>


<script src="~/js/public.countryselect.js"></script>
<script src="~/js/public.ajaxcart.js"></script>
<script src="~/js/public.common.js"></script>

@NopHtml.GenerateScripts(ResourceLocation.Footer)
@NopHtml.GenerateInlineScripts(ResourceLocation.Footer)
</body>
Expand Down

0 comments on commit 2cbdfc2

Please sign in to comment.