From 541aa5831e1ffefa61adfd06304b92592c357692 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Tue, 22 May 2012 17:37:15 +0800 Subject: [PATCH] JS changes to load drag and drop --- app/assets/javascripts/page_edit.js.erb | 6 +++++- app/views/admin/items/_site_map_left_bar.html.erb | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/page_edit.js.erb b/app/assets/javascripts/page_edit.js.erb index 7c0f6923..d7aaccd0 100644 --- a/app/assets/javascripts/page_edit.js.erb +++ b/app/assets/javascripts/page_edit.js.erb @@ -34,6 +34,10 @@ $('.part_kind').live('click', function() { }); $(document).ready(function(){ + bindTreeDragHandle(); +}); + +var bindTreeDragHandle = function(){ $('ol.sortable').nestedSortable({ disableNesting: 'no-nest', forcePlaceholderSize: true, @@ -52,4 +56,4 @@ $(document).ready(function(){ $.post("<%= Rails.application.routes.url_helpers.admin_update_position_path %>", { id: ui.item.attr('id'), parent_id: ui.item.parent().closest('li').attr('id'), position: ui.item.index() } ); } }); -}); \ No newline at end of file +} \ No newline at end of file diff --git a/app/views/admin/items/_site_map_left_bar.html.erb b/app/views/admin/items/_site_map_left_bar.html.erb index a9cf2d91..6307e5aa 100644 --- a/app/views/admin/items/_site_map_left_bar.html.erb +++ b/app/views/admin/items/_site_map_left_bar.html.erb @@ -1,3 +1,6 @@ + \ No newline at end of file