-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbackend_body.js
42 lines (42 loc) · 1.52 KB
/
backend_body.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
if(typeof jQuery != 'undefined')
{
jQuery(document).ready(function($)
{
if(typeof $.ui.sortable !== 'undefined') {
$('tbody.ui-sortable').sortable({
items: 'tr.draggable',
update: function(event, ui) {
if(ui.item.hasClass('drag_group')) {
var data = {
group_id: ui.item.data('group-id'),
prev_id : ui.item.prev().data('group-id')
};
}
else {
var data = {
item_id : ui.item.data('item-id'),
group_id: ui.item.prev().data('group-id'),
prev_id : ui.item.prev().data('item-id')
};
}
// for debugging you may activate this:
//console.log(data);
$.post(
DLGDRAGDROP,
data
);
}
});
} else {
$('.dragdrop_handle').removeClass('dragdrop_handle');
}
if( typeof $('input#title').val() != 'undefined') {
if($('input#title').val().length) {
$('span#use_filename_span').hide();
}
$('input#use_filename').change(function () {
$('input#title').toggle(!this.checked);
}).change(); //ensure visible state matches initially
}
});
}