From 630348be8ee49ad2392e3031e6872b36e2a7b5ae Mon Sep 17 00:00:00 2001 From: hukl Date: Wed, 2 Sep 2009 21:39:59 +0200 Subject: even better --- public/javascripts/admin_interface.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'public/javascripts/admin_interface.js') diff --git a/public/javascripts/admin_interface.js b/public/javascripts/admin_interface.js index 4084983..cb5ddb0 100644 --- a/public/javascripts/admin_interface.js +++ b/public/javascripts/admin_interface.js @@ -159,20 +159,17 @@ image_interface = { $("ul#image_box").sortable({ revert : true, - stop : function(event, ui) { + update : function(event, ui) { images = $("ul#image_box").sortable("serialize", {attribute : "rel"}); - if (images != image_interface.current_images) { - $.ajax({ - type : "POST", - url : "/pages/" + $("ul#image_box").attr("rel") + "/sort_images", - dataType : "json", - data : images + "&_method=put", - success : function() { - image_interface.update_current_images(); - } - }); - } + $.ajax({ + type : "POST", + url : "/pages/" + $("ul#image_box").attr("rel") + "/sort_images", + dataType : "json", + data : images + "&_method=put", + success : function() { + } + }); } }); }, -- cgit v1.3