Skip to content
Snippets Groups Projects
Commit 8ce3ae50 authored by Victor Dubiniuk's avatar Victor Dubiniuk
Browse files

Improve expand/collapse logic

parent a2445888
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,7 @@ $(document).ready(function() {
};
$('#selectDbType').buttonset();
$('#datadirContent').hide(250);
$('#databaseField').hide(250);
if($('#hasSQLite').val()){
$('#use_other_db').hide();
$('#use_oracle_db').hide();
......@@ -23,12 +22,7 @@ $(document).ready(function() {
$('#use_oracle_db').slideUp(250);
});
$('#mysql').click(function() {
$('#use_other_db').slideDown(250);
$('#use_oracle_db').slideUp(250);
});
$('#pgsql').click(function() {
$('#mysql,#pgsql,#mssql').click(function() {
$('#use_other_db').slideDown(250);
$('#use_oracle_db').slideUp(250);
});
......@@ -38,11 +32,6 @@ $(document).ready(function() {
$('#use_oracle_db').show(250);
});
$('#mssql').click(function() {
$('#use_other_db').slideDown(250);
$('#use_oracle_db').slideUp(250);
});
$('input[checked]').trigger('click');
$('#showAdvanced').click(function() {
......@@ -74,9 +63,17 @@ $(document).ready(function() {
form.submit();
return false;
});
if(!dbtypes.sqlite){
$('#showAdvanced').click();
// Expand latest db settings if page was reloaded on error
var currentDbType = $('input[type="radio"]:checked').val();
if (currentDbType === undefined){
$('input[type="radio"]').first().click();
}
if (currentDbType === 'sqlite' || (dbtypes.sqlite && currentDbType === undefined)){
$('#datadirContent').hide(250);
$('#databaseField').hide(250);
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment