diff options
Diffstat (limited to 'public/javascripts')
| -rw-r--r-- | public/javascripts/admin_interface.js | 21 |
1 files changed, 9 insertions, 12 deletions
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 = { | |||
| 159 | 159 | ||
| 160 | $("ul#image_box").sortable({ | 160 | $("ul#image_box").sortable({ |
| 161 | revert : true, | 161 | revert : true, |
| 162 | stop : function(event, ui) { | 162 | update : function(event, ui) { |
| 163 | images = $("ul#image_box").sortable("serialize", {attribute : "rel"}); | 163 | images = $("ul#image_box").sortable("serialize", {attribute : "rel"}); |
| 164 | 164 | ||
| 165 | if (images != image_interface.current_images) { | 165 | $.ajax({ |
| 166 | $.ajax({ | 166 | type : "POST", |
| 167 | type : "POST", | 167 | url : "/pages/" + $("ul#image_box").attr("rel") + "/sort_images", |
| 168 | url : "/pages/" + $("ul#image_box").attr("rel") + "/sort_images", | 168 | dataType : "json", |
| 169 | dataType : "json", | 169 | data : images + "&_method=put", |
| 170 | data : images + "&_method=put", | 170 | success : function() { |
| 171 | success : function() { | 171 | } |
| 172 | image_interface.update_current_images(); | 172 | }); |
| 173 | } | ||
| 174 | }); | ||
| 175 | } | ||
| 176 | } | 173 | } |
| 177 | }); | 174 | }); |
| 178 | }, | 175 | }, |
