summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules-available/locationinfo/page.inc.php3
-rw-r--r--modules-available/locationinfo/templates/server-settings.html14
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;
}