diff --git a/themes-default/slim/static/js/config/index.js b/themes-default/slim/static/js/config/index.js deleted file mode 100644 index b107d1305f1..00000000000 --- a/themes-default/slim/static/js/config/index.js +++ /dev/null @@ -1,32 +0,0 @@ -MEDUSA.config.index = function() { - if ($('input[name="proxy_setting"]').val().length === 0) { - $('input[id="proxy_indexers"]').prop('checked', false); - $('label[for="proxy_indexers"]').hide(); - } - - $('#theme_name').on('change', function() { - api.patch('config/main', { - theme: { - name: $(this).val() - } - }).then(response => { - log.info(response); - window.location.reload(); - }).catch(error => { - log.error(error); - }); - }); - - $('input[name="proxy_setting"]').on('input', function() { - if ($(this).val().length === 0) { - $('input[id="proxy_indexers"]').prop('checked', false); - $('label[for="proxy_indexers"]').hide(); - } else { - $('label[for="proxy_indexers"]').show(); - } - }); - - $('#log_dir').fileBrowser({ - title: 'Select log file folder location' - }); -}; diff --git a/themes-default/slim/views/config_general.mako b/themes-default/slim/views/config_general.mako index a9aa3652e23..8e5067b5f1d 100644 --- a/themes-default/slim/views/config_general.mako +++ b/themes-default/slim/views/config_general.mako @@ -17,7 +17,39 @@ window.app = {}; window.app = new Vue({ store, router, - el: '#vue-wrap' + el: '#vue-wrap', + mounted() { + if ($('input[name="proxy_setting"]').val().length === 0) { + $('input[id="proxy_indexers"]').prop('checked', false); + $('label[for="proxy_indexers"]').hide(); + } + + $('#theme_name').on('change', function() { + api.patch('config/main', { + theme: { + name: $(this).val() + } + }).then(response => { + log.info(response); + window.location.reload(); + }).catch(error => { + log.error(error); + }); + }); + + $('input[name="proxy_setting"]').on('input', function() { + if ($(this).val().length === 0) { + $('input[id="proxy_indexers"]').prop('checked', false); + $('label[for="proxy_indexers"]').hide(); + } else { + $('label[for="proxy_indexers"]').show(); + } + }); + + $('#log_dir').fileBrowser({ + title: 'Select log file folder location' + }); + } });