Skip to content
Snippets Groups Projects
Commit 398c1254 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when selecting flying team, location is autmatically marked as "Flying team"

parent 42698332
No related branches found
No related tags found
1 merge request!43when selecting flying team, location is autmatically marked as "Flying team"
Pipeline #
......@@ -90,6 +90,24 @@ function appointment_type_behaviour(checkboxes, outObject, api_call) {
});
}
/**
* When any option is selected in flying_team_select, location value is set to flying team.
*
* @param flying_team_select
* @param location_select
*/
function appointment_flying_team_place_behaviour(flying_team_select, location_select) {
$(flying_team_select).change(function () {
if ($(this).val() != "") {
$(location_select).find('option').each(function () {
if ("Flying Team" == $(this).html()) {
$(location_select).val($(this).val());
}
});
}
});
}
function get_calendar_events_function(source, allow_url_redirection) {
if (allow_url_redirection === undefined) {
allow_url_redirection = false;
......@@ -127,4 +145,4 @@ function get_calendar_events_function(source, allow_url_redirection) {
}
});
}
}
\ No newline at end of file
}
......@@ -142,6 +142,7 @@
});
appointment_type_behaviour($("input[name='appointment_types']"), $("input[name='length']"), "{% url 'web.api.appointment_types' %}");
appointment_flying_team_place_behaviour($("select[name='flying_team']"), $("select[name='location']"));
</script>
{% include "includes/datetimepicker.js.html" %}
......
......@@ -122,6 +122,7 @@
});
});
appointment_type_behaviour($("input[name='appointment-appointment_types']"), $("input[name='appointment-length']"), "{% url 'web.api.appointment_types' %}");
appointment_flying_team_place_behaviour($("select[name='appointment-flying_team']"), $("select[name='appointment-location']"));
</script>
{% include "includes/datetimepicker.js.html" %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment