diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-10 14:12:18 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-04-24 19:42:35 +0200 |
commit | 8ea4687b4cecab29affd1e451f8956d8950c2d04 (patch) | |
tree | fef7928af296fc1e5005c101c6426af7bcf12ae6 /ishtar_common/static/forms | |
parent | 6ae64bba6ae83ffa6caa497e895b8a1f568a484c (diff) | |
download | Ishtar-8ea4687b4cecab29affd1e451f8956d8950c2d04.tar.bz2 Ishtar-8ea4687b4cecab29affd1e451f8956d8950c2d04.zip |
Popup: BS style - Container: improve creation form
- prevent container creation when the same reference exists
- autocopy reference to location
Diffstat (limited to 'ishtar_common/static/forms')
-rw-r--r-- | ishtar_common/static/forms/container.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ishtar_common/static/forms/container.js b/ishtar_common/static/forms/container.js new file mode 100644 index 000000000..517b3b86d --- /dev/null +++ b/ishtar_common/static/forms/container.js @@ -0,0 +1,13 @@ +$(document).ready(function(){ + var location_changed = false; + + $("#id_select_responsible").on("autocompleteselect", function(event, ui) { + if (location_changed) return; + $("#id_select_location").val(ui.item.label); + $("#id_location").val(ui.item.id); + }); + + $("#id_select_location").on("autocompleteselect", function(event, ui){ + location_changed = true; + }); +}); |