Skip to content

Commit

Permalink
move config_general js to vue mounted
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Tyler <[email protected]>
  • Loading branch information
OmgImAlexis committed Sep 9, 2018
1 parent 7f64723 commit a58849a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
32 changes: 0 additions & 32 deletions themes-default/slim/static/js/config/index.js

This file was deleted.

34 changes: 33 additions & 1 deletion themes-default/slim/views/config_general.mako
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
}
});
</script>
</%block>
Expand Down

0 comments on commit a58849a

Please sign in to comment.