summaryrefslogtreecommitdiff
path: root/chimere/static/chimere/js/menu-sort.js
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/static/chimere/js/menu-sort.js')
-rw-r--r--chimere/static/chimere/js/menu-sort.js20
1 files changed, 20 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..ad1da39
--- /dev/null
+++ b/chimere/static/chimere/js/menu-sort.js
@@ -0,0 +1,20 @@
+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 tbody tr td').each(function (idx){
+ if($(this).is('*.field-order')){
+ $(this).hide();
+ $('div.inline-group thead th:nth-child('+idx+')').hide();
+ }
+ });
+});