silverstripe-framework/dev/install/install.js
Sam Minnee 2f45137028 BUGFIX Don't run click() on all inputs, but input:radio only (from r101173)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@111971 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-10-12 21:54:07 +00:00

39 lines
1.1 KiB
JavaScript

$(document).ready(function() {
/**
* Toggle field readonly modes, if check configuration comes from
* _ss_environment (values populated on reload).
*/
$('#use_environment').click(function(e) {
if(!$(this).is(':checked')) {
$('.configured-by-env').removeAttr('disabled');
} else {
$('.configured-by-env').attr('disabled', 'disabled');
}
});
/**
* Hide all existing database warnings, and show only current one
*/
$('#database_selection li label, input:radio').click(function(e) {
$('.dbfields').hide();
// only show fields if there's no db error
if(!$('.databaseError', $(this).parent()).length) $('.dbfields', $(this).parent()).show();
$('.databaseError').hide();
$('.databaseError', $(this).parent()).show();
});
// Select first
$('#database_selection li input:checked').siblings('label').click();
/**
* Install button
*/
$('#ReIn').click(function() {
$('#install_button').attr('disabled', !$(this).is(':checked'));
})
$('#install_button').click(function() {
$('#saving_top').hide();
$(this).val('Installing SilverStripe...');
})
});