diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2013-10-11 16:35:59 +0300 |
---|---|---|
committer | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2013-10-11 16:35:59 +0300 |
commit | 8ce3ae50f0894574bab1e086e1fe83cebc3b5633 (patch) | |
tree | 4266278b1fc5858d524e6926ebdc056bfaba82c1 /core | |
parent | a2445888e803bb62322aa83c1be239cbf0a8227c (diff) | |
download | nextcloud-server-8ce3ae50f0894574bab1e086e1fe83cebc3b5633.tar.gz nextcloud-server-8ce3ae50f0894574bab1e086e1fe83cebc3b5633.zip |
Improve expand/collapse logic
Diffstat (limited to 'core')
-rw-r--r-- | core/js/setup.js | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/core/js/setup.js b/core/js/setup.js index 62f313fc501..0863be35886 100644 --- a/core/js/setup.js +++ b/core/js/setup.js @@ -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); + } + }); |