wcs/wcs/qommon/static/js/biglist.js

35 lines
1.1 KiB
JavaScript

$(document).ready(
function () {
$('ul.biglist.sortable').Sortable(
{
accept: 'biglistitem',
helperclass: 'sortHelper',
activeclass : 'sortableactive',
hoverclass : 'sortablehover',
tolerance: 'pointer',
onChange : function(ser)
{
result = '';
items = $('ul.biglist li');
for (i=0; i < items.length; i++) {
item = items[i];
// 6 is length of 'itemId'
result += item.id.substr(7, 30) + ';';
}
$.post('update_order', {'order': result},
function(data) { $('ul.biglist').Highlight(500, '#ff8'); });
},
onStart : function()
{
$.iAutoscroller.start(this, document.getElementsByTagName('body'));
},
onStop : function()
{
$.iAutoscroller.stop();
}
}
);
}
);