diff options
author | Simon Rettberg | 2017-05-08 14:20:27 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-05-08 14:20:27 +0200 |
commit | 6d37ffa72f8fdbbeb35430dd326f86be4ef816a3 (patch) | |
tree | e4c540aa2455549140d012cc05f3122c095e4f45 /modules-available/locationinfo | |
parent | [statistics_reporting] Add link to wiki explaining remote reporting in detail (diff) | |
download | slx-admin-6d37ffa72f8fdbbeb35430dd326f86be4ef816a3.tar.gz slx-admin-6d37ffa72f8fdbbeb35430dd326f86be4ef816a3.tar.xz slx-admin-6d37ffa72f8fdbbeb35430dd326f86be4ef816a3.zip |
[locationinfo] Fix initial selection of backend type when creating server
Fixes #3130
Diffstat (limited to 'modules-available/locationinfo')
-rw-r--r-- | modules-available/locationinfo/page.inc.php | 3 | ||||
-rw-r--r-- | modules-available/locationinfo/templates/server-settings.html | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php index bda6549b..4ad2ab0f 100644 --- a/modules-available/locationinfo/page.inc.php +++ b/modules-available/locationinfo/page.inc.php @@ -481,7 +481,8 @@ class Page_LocationInfo extends Page echo Render::parse('server-settings', array('id' => $id, 'name' => $oldConfig['servername'], 'currentbackend' => $oldConfig['servertype'], - 'backendList' => $serverBackends)); + 'backendList' => $serverBackends, + 'defaultBlank' => $oldConfig === false)); } /** diff --git a/modules-available/locationinfo/templates/server-settings.html b/modules-available/locationinfo/templates/server-settings.html index c9b713e6..51e5bff6 100644 --- a/modules-available/locationinfo/templates/server-settings.html +++ b/modules-available/locationinfo/templates/server-settings.html @@ -25,6 +25,9 @@ </div> <div class="col-md-7"> <select class="form-control" onchange="servertype_changed(this.value)"> + {{#defaultBlank}} + <option value="" selected>{{lang_pleaseSelect}}</option> + {{/defaultBlank}} {{#backendList}} <option value="{{backendtype}}" {{#active}}selected{{/active}}>{{display}}</option> {{/backendList}} @@ -75,12 +78,15 @@ if (value === currentBackend) return; var newBackend = value; - console.log('From ' + currentBackend + ' to ' + value); - $('#formwrapper-' + currentBackend).fadeOut('fast', function() { - console.log('Fading in ' + newBackend); + var fadeIn = function() { $('#formwrapper-' + newBackend).fadeIn('fast'); $('#myModalSubmitButton, #name-input').attr('form', 'form-' + newBackend); - }); + }; + if (currentBackend) { + $('#formwrapper-' + currentBackend).fadeOut('fast', fadeIn); + } else { + fadeIn(); + } currentBackend = value; } |