diff --git a/app/pathfinder.ini b/app/pathfinder.ini index 1280f952..ff4741cc 100644 --- a/app/pathfinder.ini +++ b/app/pathfinder.ini @@ -125,7 +125,7 @@ SEND_RALLY_Mail_ENABLED = 0 [PATHFINDER.ROUTE] ; max recursive search depth for routes (default: 7000) ; decrease it on performance problems -SEARCH_DEPTH = 7000 +SEARCH_DEPTH = 9000 ; default count of routes that will be checked (initial) when a system is selected (default: 2) SEARCH_DEFAULT_COUNT = 2 ; max count of routes that can be selected in "route settings" dialog (default: 4) diff --git a/js/app/admin.js b/js/app/admin.js index 29f95f4b..c41ccdd1 100644 --- a/js/app/admin.js +++ b/js/app/admin.js @@ -24,6 +24,39 @@ define([ $('.' + config.triggerOverlayClass).on('click', function(){ $('.' + config.splashOverlayClass).showSplashOverlay(); }); + + // set fieldset toggled by checkbox --------------------------------------------------------------------------- + $('input[type="checkbox"][data-target]').on('change', function(){ + let targetId = $(this).attr('data-target'); + if(targetId){ + let targetElement = $('[data-id="' + targetId + '"]'); + let targetFormFields = targetElement.find('input[type="radio"]'); + let checkFormFields = []; + for(let formField of targetFormFields) { + if(this.checked){ + if(formField.hasAttribute('data-default') || formField.getAttribute('data-default-value')){ + checkFormFields.push(formField); + } + }else{ + formField.setAttribute('data-default-value', formField.checked ? 'checked' : ''); + if(formField.hasAttribute('data-default')){ + checkFormFields.push(formField); + } + } + } + + for(let checkFormField of checkFormFields) { + checkFormField.checked = true; + } + } + }); + + $('input[type="radio"]').on('change', function(){ + if(this.checked){ + let targetId = $(this).parents('fieldset').attr('data-id'); + $('input[type="checkbox"][data-target="' + targetId + '"]').prop('checked', true); + } + }); }; /** diff --git a/public/js/v1.3.3/app/admin.js b/public/js/v1.3.3/app/admin.js index 29f95f4b..c41ccdd1 100644 --- a/public/js/v1.3.3/app/admin.js +++ b/public/js/v1.3.3/app/admin.js @@ -24,6 +24,39 @@ define([ $('.' + config.triggerOverlayClass).on('click', function(){ $('.' + config.splashOverlayClass).showSplashOverlay(); }); + + // set fieldset toggled by checkbox --------------------------------------------------------------------------- + $('input[type="checkbox"][data-target]').on('change', function(){ + let targetId = $(this).attr('data-target'); + if(targetId){ + let targetElement = $('[data-id="' + targetId + '"]'); + let targetFormFields = targetElement.find('input[type="radio"]'); + let checkFormFields = []; + for(let formField of targetFormFields) { + if(this.checked){ + if(formField.hasAttribute('data-default') || formField.getAttribute('data-default-value')){ + checkFormFields.push(formField); + } + }else{ + formField.setAttribute('data-default-value', formField.checked ? 'checked' : ''); + if(formField.hasAttribute('data-default')){ + checkFormFields.push(formField); + } + } + } + + for(let checkFormField of checkFormFields) { + checkFormField.checked = true; + } + } + }); + + $('input[type="radio"]').on('change', function(){ + if(this.checked){ + let targetId = $(this).parents('fieldset').attr('data-id'); + $('input[type="checkbox"][data-target="' + targetId + '"]').prop('checked', true); + } + }); }; /** diff --git a/public/templates/admin/settings.html b/public/templates/admin/settings.html index 42792d08..95fa90ca 100644 --- a/public/templates/admin/settings.html +++ b/public/templates/admin/settings.html @@ -6,6 +6,9 @@
+ + +
@@ -19,7 +22,7 @@ -