Browse Source

Module template: Add dir and lang attributes to html tag for Blazor (RTL)

pull/10374/head
Engincan VESKE 5 years ago
parent
commit
f1e7111583
  1. 13
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/index.html
  2. 17
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/main.js

13
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/index.html

@ -14,16 +14,17 @@
</head>
<body class="abp-application-layout bg-light">
<div id="ApplicationContainer">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
<div id="ApplicationContainer">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
</div>
<!--ABP:Scripts-->
<!--ABP:Scripts-->
<script src="global.js?_v=637701706654165281"></script>
<!--/ABP:Scripts-->
<script src="main.js"></script>
</body>
</html>

17
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/main.js

@ -0,0 +1,17 @@
(
function () {
var isRtl = JSON.parse(localStorage.getItem("Abp.IsRtl"));
var htmlTag = document.getElementsByTagName("html")[0];
if (htmlTag) {
var selectedLanguage = localStorage.getItem("Abp.SelectedLanguage");
if (selectedLanguage) {
htmlTag.setAttribute("lang", selectedLanguage);
}
if (isRtl) {
htmlTag.setAttribute("dir", "rtl");
}
}
}
)();
Loading…
Cancel
Save