diff --git a/app/js/platform/first.js b/app/js/platform/first.js index d2d9528c..f88f0eaa 100644 --- a/app/js/platform/first.js +++ b/app/js/platform/first.js @@ -4,7 +4,11 @@ window.onload = function() { connection() initPlugin(plugins) if (localStorage.getItem('control-center-np')) $('#ccnp').removeClass('hide') + } + +const size = localStorage.getItem('size') +if (size) $('html,body').css('font-size', `${size}px`) $.strip_tags = function(str, allowed) { if (!str) { return '' diff --git a/app/js/ui/layout.js b/app/js/ui/layout.js index 40850eae..eec3bdfa 100644 --- a/app/js/ui/layout.js +++ b/app/js/ui/layout.js @@ -26,12 +26,6 @@ function parseColumn(target, dontclose) { target = 'zero' } console.log('%c Parse column', 'color:red;font-size:125%') - var size = localStorage.getItem('size') - if (size) { - $('#timeline-container').css('font-size', size + 'px') - $('.toot-reset').css('font-size', size + 'px') - $('.cont-series').css('font-size', size + 'px') - } if (localStorage.getItem('menu-done')) { $('#fukidashi').addClass('hide') } diff --git a/app/js/ui/settings.js b/app/js/ui/settings.js index a03854b6..ec98f7a4 100644 --- a/app/js/ui/settings.js +++ b/app/js/ui/settings.js @@ -1,5 +1,5 @@ //設定(setting.html)で読む -Vue.createApp({ +const envView = Vue.createApp({ data() { return { config: envConstruction @@ -7,7 +7,7 @@ Vue.createApp({ }, methods: { complete: function (i, val) { - var ls = envView.config[i] + var ls = this.config[i] let header = ls.text.head if (!ls.data) { ls = [ls] @@ -32,16 +32,19 @@ Vue.createApp({ if (ls[0].id == 'frame') { frameSet(val) } + if (ls[0].id == 'size') { + $('html,body').css('font-size', `${val}px`) + } M.toast({ html: `Updated: ${header}`, displayLength: 3000 }) return true }, }, }).mount('#envView') -Vue.createApp({ +const tlView = Vue.createApp({ data() { return { config: tlConstruction } }, methods: { complete: function (i, val) { - var ls = tlView.config[i] + var ls = this.config[i] let header = ls.text.head if (val) { localStorage.setItem(ls.storage, val) @@ -62,7 +65,7 @@ Vue.createApp({ }, }, }).mount('#tlView') -Vue.createApp({ +const postView = Vue.createApp({ data() { return { config: postConstruction, @@ -72,7 +75,7 @@ Vue.createApp({ }, methods: { complete: function (i, val) { - var ls = postView.config[i] + var ls = this.config[i] let header = ls.text.head if (val) { localStorage.setItem(ls.storage, val)