-
Notifications
You must be signed in to change notification settings - Fork 4
/
admin.js
40 lines (31 loc) · 988 Bytes
/
admin.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
jQuery(document).ready(function(){
jQuery( "#sortable" ).sortable({
update: function() {
wpiUpdateSteps();
}
});
jQuery( "#sortable" ).disableSelection();
jQuery( ".wpi_del" ).click(function(){
jQuery(this).parent().parent().remove();
wpiUpdateSteps();
});
jQuery( "#wpi_page" ).change(function(){
if(jQuery(this).val() == 'other'){
jQuery( "#wpi_custom_url_panel" ).show();
}else{
jQuery( "#wpi_custom_url_panel" ).hide();
}
});
});
function wpiUpdateSteps(){
var selected_ids = '';
jQuery(".wip_sort").each(function() {
selected_ids += jQuery(this).attr("data-identifier")+"@";
});
var tour_id = jQuery('#wpi_tour').val();
jQuery.post(conf.ajaxURL, {
action: "wpintro_update_step_order",
selected_id:selected_ids,
tour_id : tour_id
}, function(data) { }, "json" );
}