diff options
Diffstat (limited to 'chimere/static/chimere/js/menu-sort.js')
| -rw-r--r-- | chimere/static/chimere/js/menu-sort.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chimere/static/chimere/js/menu-sort.js b/chimere/static/chimere/js/menu-sort.js new file mode 100644 index 0000000..37d0ddd --- /dev/null +++ b/chimere/static/chimere/js/menu-sort.js @@ -0,0 +1,24 @@ +jQuery(function($) { + $('div.inline-group tbody').sortable({ + /*containment: 'parent', + zindex: 10, */ + update: function() { + $(this).find('tr').each(function(i) { + if ($(this).find('input[id$=name]').val()) { + $(this).find('input[id$=order]').val(i+1); + } + }); + } + }); + $('div.inline-group tbody tr').css('cursor', 'move'); + $('div.inline-group').each(function(){ + var par = $(this); + par.find('tbody tr td').each( + function (idx){ + if($(this).is('*.field-order')){ + $(this).hide(); + par.find('thead th:nth-child('+idx+')').hide(); + } + }); + }); +}); |
