This commit is contained in:
SauroPollastrini 2016-12-02 13:43:59 +01:00
commit 44be5a2beb
35 changed files with 1667 additions and 634 deletions

View file

@ -620,24 +620,7 @@ print[[
dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")
print([[<script>
/* jQuery AreYouSure plugin activation */
// Disable save buttons by default
$('form').find('button[type="submit"]').attr('disabled', 'disabled');
$(function() {
// Enable on all forms
$('form').areYouSure();
$('form').on('dirty.areYouSure', function() {
// Enable save button only as the form is dirty.
$(this).find('button[type="submit"]').removeAttr('disabled');
});
$('form').on('clean.areYouSure', function() {
// Form is clean so nothing to save - disable the save button.
$(this).find('button[type="submit"]').attr('disabled', 'disabled');
});
});
aysHandleForm();
</script>]])
end