diff options
| author | michael pereira | 2011-04-26 11:26:07 +0200 |
|---|---|---|
| committer | michael pereira | 2011-04-26 11:26:07 +0200 |
| commit | 6db512dcfdbafc6c89192cb735a672cd2615eee2 (patch) | |
| tree | 9965db04e7972799c45692382bd9db089d4ac13e /application/modules/user/views/scripts | |
| parent | ui-sortable (diff) | |
| download | pbs2-6db512dcfdbafc6c89192cb735a672cd2615eee2.tar.gz pbs2-6db512dcfdbafc6c89192cb735a672cd2615eee2.tar.xz pbs2-6db512dcfdbafc6c89192cb735a672cd2615eee2.zip | |
ui-sortable
Diffstat (limited to 'application/modules/user/views/scripts')
| -rw-r--r-- | application/modules/user/views/scripts/bootmenu/index.phtml | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/application/modules/user/views/scripts/bootmenu/index.phtml b/application/modules/user/views/scripts/bootmenu/index.phtml index 6758fae..c736fca 100644 --- a/application/modules/user/views/scripts/bootmenu/index.phtml +++ b/application/modules/user/views/scripts/bootmenu/index.phtml @@ -205,24 +205,23 @@ <script> $(document).ready(function(){ + function getId(el){ if(el.attr) return el.attr("id").split("-").pop();; return 0; } - $(function() { - $( "#sortable" ).sortable({ - update: function(event, ui){ - var nxt_id = getId(ui.item.next()); - var id = getId(ui.item); - if(id < nxt_id) - nxt_id = (nxt_id-1); - location.href=ui.item.find('.edit').attr('href')+'/neworder/'+(nxt_id); - } - }); - $( "#sortable" ).disableSelection(); - }); + $( "#sortable" ).sortable({ + update: function(event, ui){ + var nxt_id = getId(ui.item.next()); + var id = getId(ui.item); + if(id < nxt_id) + nxt_id = (nxt_id-1); + location.href=ui.item.find('.edit').attr('href')+'/neworder/'+(nxt_id); + } + }); + $( "#sortable" ).disableSelection(); $('.actions .play').click(function (){ $("#notification").load($(this).attr('href')).addClass('infobox').show(); |
