INNER CODE UNIT · JavaScript
_updateThemeLogo
nisrulz/app-privacy-policy-generator · src/js/main.js:28
function _updateThemeLogo() {
var theme = document.documentElement.getAttribute('data-theme');
document.querySelectorAll('img[data-theme-logo]').forEach(function (img) {
var light = img.getAttribute('data-light-src') || img.src;
if (!img.getAttribute('data-light-src')) {
img.setAttribute('data-light-src', img.src);
img.setAttribute('data-dark-src', img.src.replace(/(\.\w+)$/, '_dark$1'));
}
img.src = theme === 'dark' ? img.getAttribute('data-dark-src') : img.getAttribute('data-light-src');
});
}
function useAppState() {
var { reactive, computed } = Vue;
var state = reactive({
currentLocale: document.documentElement.getAttribute('lang') || 'en',
availableLocales: window.availableLocalesJsonArray || [],