summaryrefslogtreecommitdiff
path: root/chimere/static
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-09-19 13:24:34 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-09-19 13:24:34 +0200
commitbc77ba9c7c21bdcb42a4b45a1011f9219d712f6d (patch)
treea2c33843cf4c6636fbd51d02bae8bee9529d7422 /chimere/static
parent2248ec72d22c91142d568857b8a8d8f785860fe5 (diff)
downloadChimère-bc77ba9c7c21bdcb42a4b45a1011f9219d712f6d.tar.bz2
Chimère-bc77ba9c7c21bdcb42a4b45a1011f9219d712f6d.zip
Admin: simplify category management
Diffstat (limited to 'chimere/static')
-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();
+ }
+ });
+});