Dotclear

source: plugins/antispam/antispam.js @ 0:54703be25dd6

Revision 0:54703be25dd6, 783 bytes checked in by Dsls <dsls@…>, 14 years ago (diff)

2.3 branch (trunk) first checkin

Line 
1var dragsort = ToolMan.dragsort();
2$(function() {
3     $("#filters-list").each(function() {
4          dragsort.makeTableSortable(this,dotclear.sortable.setHandle, dotclear.sortable.saveOrder);
5     });
6});
7
8dotclear.sortable = {
9     setHandle: function(item) {
10          var handle = $(item).find('td.handle').get(0);
11          while (handle.firstChild) {
12               handle.removeChild(handle.firstChild);
13          }
14         
15          item.toolManDragGroup.setHandle(handle);
16          $(handle).addClass('handler');
17     },
18     
19     saveOrder: function(item) {
20          var group = item.toolManDragGroup;
21          var order = $('#filters_order').get(0);
22          group.register('dragend', function() {
23               order.value = '';
24               items = item.parentNode.getElementsByTagName('tr');
25               
26               for (var i=0; i<items.length; i++) {
27                    order.value += items[i].id.substr(2)+',';
28               }
29          });
30     }
31};
Note: See TracBrowser for help on using the repository browser.

Sites map