From a9e2b04477c968db7d4e255a2755523fd9bf9527 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 10 Apr 2019 14:12:18 +0200 Subject: Popup: BS style - Container: improve creation form - prevent container creation when the same reference exists - autocopy reference to location --- ishtar_common/static/forms/container.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ishtar_common/static/forms/container.js (limited to 'ishtar_common/static/forms/container.js') 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; + }); +}); -- cgit v1.2.3