diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-11-15 16:29:30 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:23:19 +0100 |
commit | cda77c979e232386ef24ea7a04600f16f3c32c98 (patch) | |
tree | 7d53e762723338913594ccdb42c6fa08c4bfb5ef /archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js | |
parent | 4746cd2938df3cf87ae338d22eb4f67f35bac960 (diff) | |
download | Ishtar-cda77c979e232386ef24ea7a04600f16f3c32c98.tar.bz2 Ishtar-cda77c979e232386ef24ea7a04600f16f3c32c98.zip |
File module refactoring - more tests for files
Diffstat (limited to 'archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js')
-rw-r--r-- | archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js b/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js deleted file mode 100644 index 1877e4579..000000000 --- a/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js +++ /dev/null @@ -1,66 +0,0 @@ -person_save_callback = function(item_id, lbl){ - var url = {{edit_source}}; - $('#id_{{field_id}}').val(null); - $('#id_select_{{field_id}}').val(lbl); - if (item_id){ - url = {{edit_source}}+item_id; - $('#id_{{field_id}}').val(item_id); - } - $("#id_select_{{field_id}}").trigger('autocompletechange'); - $.get(url , function( data ) { - $( "#div-{{field_id}}" ).html( data ); - }); -}; - -edit_url = {{edit_source}}; -parent_id = "{{field_id}}"; - -person_new_callback = function(){ - var url = {{edit_source}}; - $('#id_{{field_id}}').val(null); - $('#id_select_{{field_id}}').val(null); -} - -$(function() { - var $radios = $('input:radio[name=person_type]'); - if($radios.is(':checked') === false) { - $radios.filter('[value='+ current_status +']').prop('checked', true); - } - - $radios.change(function(){ - var loc = window.location; - window.location = loc.protocol + '//' + loc.host + loc.pathname + "?status=" + $('input:radio[name=person_type]:checked').val(); - }); - - $("#id_select_{{field_id}}").autocomplete({ - source: {{source}}, - select: function( event, ui ) { - var url = {{edit_source}}; - if(ui.item){ - url = {{edit_source}}+ui.item.id; - $('#id_{{field_id}}').val(ui.item.id); - $('#id_{{field_id}}').change(); - } else { - $('#id_{{field_id}}').val(null); - } - $.get(url, function( data ) { - $( "#div-{{field_id}}" ).html( data ); - }); - }, - minLength: 2{% if options %}, - {{options}} - {% endif %} - }); - - $.get( {{edit_source}}{% if selected %}+'{{selected}}'{% endif %}, function( data ) { - $( "#div-{{field_id}}" ).html( data ); - }); - - $(document).on("click", '#id_select_{{field_id}}', function(){ - $('#id_{{field_id}}').val(null); - $('#id_select_{{field_id}}').val(null); - $.get( {{edit_source}}, function( data ) { - $( "#div-{{field_id}}" ).html( data ); - }); - }); -}); |