From 7b84cc63723112b11b0d08e6c4447b38c66658b9 Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Tue, 5 Nov 2019 23:26:42 +0100 Subject: [PATCH] fix deleting courses, purge redundant code, old jquery. Closes #27 --- html/assets/js/calcscript.js | 27 ++---------------------- html/include/html_script_bottom_head.php | 2 +- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/html/assets/js/calcscript.js b/html/assets/js/calcscript.js index 05dc414..422d99a 100644 --- a/html/assets/js/calcscript.js +++ b/html/assets/js/calcscript.js @@ -1,35 +1,12 @@ $(document).ready(function() { - $('.select_programme').change(function() { - var myText = $(".select_programme option:selected").text(); - var options = ''; - //$('.courses').append(''); - } else { - row = row + ''; - row = row + options; - row = row + 'Ta bort rad<\/a><\/div>'; - //$('.courses').append(''); - //$('.courses').append(options); - $('.courses').append(row); - } - }); - }); - $('.courses').append(''); - $('.courses').append(''); - }); $('form').change(function() { raknaUtMeritvarde(); }); - $('.add_row').on('click', function() { + $('.add_row').live('click', function() { $('div.sample_row > div').clone().appendTo('form.courses'); raknaUtMeritvarde(); }); - $('.delete_row').on('click', function() { + $('.delete_row').live('click', function() { $(this).parent().slideUp(function() { $(this).remove(); raknaUtMeritvarde(); diff --git a/html/include/html_script_bottom_head.php b/html/include/html_script_bottom_head.php index e397029..951ec24 100644 --- a/html/include/html_script_bottom_head.php +++ b/html/include/html_script_bottom_head.php @@ -2,7 +2,7 @@ echo "