-
Notifications
You must be signed in to change notification settings - Fork 65
/
policy_edit.js
52 lines (49 loc) · 1.3 KB
/
policy_edit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function scap_content_selected(element){
var attrs = attribute_hash(['scap_content_id']);
var url = $(element).attr('data-url');
tfm.tools.showSpinner();
$.ajax({
data: attrs,
type: 'post',
url: url,
complete: function() { reloadOnAjaxComplete($(element));},
success: function(request) {
$('#scap_content_profile_select').html(request);
}
})
}
function tailoring_file_selected(element) {
var attrs = attribute_hash(['tailoring_file_id']);
var url = $(element).attr('data-url');
tfm.tools.showSpinner();
$.ajax({
data: attrs,
type: 'post',
url: url,
complete: function() { reloadOnAjaxComplete($(element));},
success: function(request) {
$('#tailoring_file_profile_select').html(request);
}
})
}
function previous_step(previous) {
$('#policy_current_step').val(previous);
$('#new_policy').submit();
}
function period_selected(period) {
$("#policy_weekday, #policy_day_of_month, #policy_cron_line").closest("div.clearfix").hide();
switch($(period).val()) {
case 'weekly':
field = "#policy_weekday";
break;
case 'monthly':
field = "#policy_day_of_month";
break;
case 'custom':
field = "#policy_cron_line";
break;
default:
field = "";
}
$(field).closest("div.clearfix").show();
}