aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/admin/category-order.js9
1 files changed, 1 insertions, 8 deletions
diff --git a/app/assets/javascripts/admin/category-order.js b/app/assets/javascripts/admin/category-order.js
index 6e210083c..3be82e46f 100644
--- a/app/assets/javascripts/admin/category-order.js
+++ b/app/assets/javascripts/admin/category-order.js
@@ -1,14 +1,12 @@
$(function() {
- var endpoints = { 'heading' : '/admin/category_heading/reorder',
- 'category' : '/admin/category/reorder' }
$('.save-order').each(function(index){
// identify the elements that will work together
var save_button = $(this);
var save_notice = save_button.next();
var save_panel = save_button.parent();
- var list_type = save_button.data('list-type');
var list_element = $(save_button.data('list-id'));
+ var endpoint = save_button.data('endpoint');
// on the first list change, show that there are unsaved changes
list_element.sortable({
@@ -24,11 +22,6 @@ $(function() {
save_button.click(function(){
if (!save_button.is('.disabled')){
var data = list_element.sortable('serialize', {'attribute': 'data-id'});
- var endpoint = endpoints[list_type];
- if (list_type == 'category'){
- heading_id = save_button.data('heading-id');
- endpoint = endpoint + "/" + heading_id;
- }
var update_call = $.ajax({ data: data, type: 'POST', url: endpoint });
// on success, disable the save button again, and show success notice