Use Interop

This commit is contained in:
hishamco
2020-12-02 02:10:01 +03:00
parent 75556070d6
commit 330499dda5
5 changed files with 42 additions and 11 deletions

View File

@ -1,4 +1,4 @@
@page "/"
@page "/"
@namespace Oqtane.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using System.Globalization
@ -48,12 +48,6 @@
@if (Configuration.GetSection("Runtime").Value == "WebAssembly")
{
<script src="_framework/blazor.webassembly.js"></script>
<script>
window.oqtaneCulture = {
get: () => window.localStorage['OqtaneCulture'],
set: (value) => window.localStorage['OqtaneCulture'] = value
};
</script>
}
else
{

View File

@ -362,5 +362,11 @@ Oqtane.Interop = {
setInterval(function () {
window.location.href = url;
}, wait * 1000);
},
getCulture: function () {
return window.localStorage['OqtaneCulture'];
},
setCulture: function (culture) {
window.localStorage['OqtaneCulture'] = culture;
}
};