summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
Diffstat (limited to 'module/web')
-rw-r--r--module/web/ajax/views.py14
-rw-r--r--module/web/templates/default/package_ui.js16
2 files changed, 13 insertions, 17 deletions
diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py
index 5a6fc7b69..9430a54d4 100644
--- a/module/web/ajax/views.py
+++ b/module/web/ajax/views.py
@@ -212,7 +212,7 @@ def package_order(request, ids):
try:
pid, pos = ids.split("|")
settings.PYLOAD.order_package(int(pid), int(pos))
- return JsonResponse("sucess")
+ return JsonResponse("success")
except:
print_exc()
return HttpResponseServerError()
@@ -222,7 +222,7 @@ def link_order(request, ids):
try:
pid, pos = ids.split("|")
settings.PYLOAD.order_file(int(pid), int(pos))
- return JsonResponse("sucess")
+ return JsonResponse("success")
except:
print_exc()
return HttpResponseServerError()
@@ -240,7 +240,7 @@ def link(request, id):
def remove_package(request, id):
try:
settings.PYLOAD.del_packages([int(id)])
- return JsonResponse("sucess")
+ return JsonResponse("success")
except Exception, e:
print_exc()
return HttpResponseServerError()
@@ -249,7 +249,7 @@ def remove_package(request, id):
def restart_package(request, id):
try:
settings.PYLOAD.restart_package(int(id))
- return JsonResponse("sucess")
+ return JsonResponse("success")
except Exception:
return HttpResponseServerError()
@@ -257,7 +257,7 @@ def restart_package(request, id):
def restart_link(request, id):
try:
settings.PYLOAD.restart_file(int(id))
- return JsonResponse("sucess")
+ return JsonResponse("success")
except Exception:
return HttpResponseServerError()
@@ -265,7 +265,7 @@ def restart_link(request, id):
def abort_link(request, id):
try:
settings.PYLOAD.stop_download("link", int(id))
- return JsonResponse("sucess")
+ return JsonResponse("success")
except:
return HttpResponseServerError()
@@ -273,7 +273,7 @@ def abort_link(request, id):
def move_package(request, dest, id):
try:
settings.PYLOAD.move_package(int(dest), int(id))
- return JsonResponse("sucess")
+ return JsonResponse("success")
except:
return HttpResponseServerError()
diff --git a/module/web/templates/default/package_ui.js b/module/web/templates/default/package_ui.js
index 759412621..1c9505bc9 100644
--- a/module/web/templates/default/package_ui.js
+++ b/module/web/templates/default/package_ui.js
@@ -65,12 +65,10 @@ var PackageUI = new Class({
saveSort: function(ele, copy) {
var order = [];
- this.sorts.serialize(function(ele,pos){
- if (ele.retrieve("order") != pos){
- order.push(ele.retrieve("pid")+"|"+pos);
- ele.store("order", pos);
+ this.sorts.serialize(function(li,pos){
+ if (li == ele && ele.retrieve("order") != pos){
+ order.push(ele.retrieve("pid")+"|"+pos)
}
-
});
if (order.length > 0){
indicateLoad();
@@ -315,12 +313,10 @@ var Package = new Class({
saveSort: function(ele, copy) {
var order = [];
- this.sorts.serialize(function(ele,pos){
- if (ele.retrieve("order") != pos){
- order.push(ele.retrieve("lid")+"|"+pos);
- ele.store("order", pos);
+ this.sorts.serialize(function(li,pos){
+ if (li == ele && ele.retrieve("order") != pos){
+ order.push(ele.retrieve("lid")+"|"+pos)
}
-
});
if (order.length > 0){
indicateLoad();