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 ebe146a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 34 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
1 change: 0 additions & 1 deletion themes-default/slim/views/layouts/main.mako
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@

<script type="text/javascript" src="js/parsers.js?${sbPID}"></script>

<script type="text/javascript" src="js/config/index.js?${sbPID}"></script>
<script type="text/javascript" src="js/config/init.js?${sbPID}"></script>
<script type="text/javascript" src="js/config/notifications.js?${sbPID}"></script>

Expand Down

0 comments on commit ebe146a

Please sign in to comment.