AJAX reordered list back to yesod. THIS TOOK 3 HOURS. Aargh

This commit is contained in:
Joey Hess 2013-03-14 11:55:36 -04:00
parent e0e01ee671
commit 6af91dadb8
4 changed files with 19 additions and 25 deletions

View file

@ -11,8 +11,8 @@
Repositories
<table .table .table-condensed>
<tbody #costsortable>
$forall (_num, name, actions) <- repolist
<tr .repoline>
$forall (num, name, (uuid, actions)) <- repolist
<tr .repoline ##{"costsortable_" ++ fromUUID uuid}>
<td .handle>
<i .icon-resize-vertical></i>
#{name}

View file

@ -8,8 +8,14 @@ $(function() {
},
stop: function(event, ui) {
ui.item.children(".draghide").show();
var list = $("#costsortable").sortable("toArray");
var moved = ui.item.attr("id");
$.ajax({
'url': "http://localhost/testajax",
'url': "@{RepositoriesReorderR}",
'data': {
'moved': moved,
'list': list
}
});
},
});