re-setup repolist after longpoll refresh
This commit is contained in:
parent
7289f92522
commit
f3c999062d
2 changed files with 28 additions and 20 deletions
|
@ -3,12 +3,15 @@
|
|||
|
||||
connfails=0;
|
||||
|
||||
longpollcallbacks = $.Callbacks();
|
||||
|
||||
function longpoll(url, divid, cont, fail) {
|
||||
$.ajax({
|
||||
'url': url,
|
||||
'dataType': 'html',
|
||||
'success': function(data, status, jqxhr) {
|
||||
$('#' + divid).replaceWith(data);
|
||||
longpollcallbacks.fire();
|
||||
connfails=0;
|
||||
cont();
|
||||
},
|
||||
|
|
|
@ -1,22 +1,27 @@
|
|||
$(function() {
|
||||
$("#costsortable").sortable({
|
||||
handle: ".handle",
|
||||
cursor: "move",
|
||||
forceHelperSize: true,
|
||||
start: function(event, ui) {
|
||||
ui.item.children(".draghide").hide();
|
||||
},
|
||||
stop: function(event, ui) {
|
||||
ui.item.children(".draghide").show();
|
||||
var list = $("#costsortable").sortable("toArray");
|
||||
var moved = ui.item.attr("id");
|
||||
$.ajax({
|
||||
'url': "@{RepositoriesReorderR}",
|
||||
'data': {
|
||||
'moved': moved,
|
||||
'list': list
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
var setup = function() {
|
||||
$("#costsortable").sortable({
|
||||
handle: ".handle",
|
||||
cursor: "move",
|
||||
forceHelperSize: true,
|
||||
start: function(event, ui) {
|
||||
ui.item.children(".draghide").hide();
|
||||
},
|
||||
stop: function(event, ui) {
|
||||
ui.item.children(".draghide").show();
|
||||
var list = $("#costsortable").sortable("toArray");
|
||||
var moved = ui.item.attr("id");
|
||||
$.ajax({
|
||||
'url': "@{RepositoriesReorderR}",
|
||||
'data': {
|
||||
'moved': moved,
|
||||
'list': list
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
longpollcallbacks.add(setup);
|
||||
setup();
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue