X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/db11732b27f9d7bd86fb6bf1cd4150e59a54559f..e2b0403982edf5a329b4dfc9d2b169eac91c3dd8:/js/kivi.GoBD.js diff --git a/js/kivi.GoBD.js b/js/kivi.GoBD.js new file mode 100644 index 000000000..9e8c3ecfe --- /dev/null +++ b/js/kivi.GoBD.js @@ -0,0 +1,23 @@ +namespace('kivi.GoBD', function(ns) { + ns.grey_invalid_options = function(el){ + console.log(el); + if ($(el).prop('checked')) { + $(el).closest('tr').find('input.datepicker').prop('disabled', false).datepicker('enable'); + $(el).closest('tr').find('select').prop('disabled', 0); + } else { + $(el).closest('tr').find('input.datepicker').prop('disabled', true).datepicker('disable'); + $(el).closest('tr').find('select').prop('disabled', 1); + } + } + + ns.update_all_radio = function () { + $('input[type=radio]').each(function(i,e) {ns.grey_invalid_options (e) }); + } + + ns.setup = function() { + ns.update_all_radio(); + $('input[type=radio]').change(ns.update_all_radio); + } +}); + +$(kivi.GoBD.setup);