From 4dc9076224a0d93f0dc078124aa9fb94a669f16c Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 19 Nov 2010 03:28:41 +0000 Subject: saving widget position after moving git-svn-id: http://code.elgg.org/elgg/trunk@7343 36083f99-b078-4883-b0ff-0f9b5a30f544 --- js/lib/ui.widgets.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js index 507a1a1a8..32de71871 100644 --- a/js/lib/ui.widgets.js +++ b/js/lib/ui.widgets.js @@ -6,7 +6,18 @@ elgg.ui.widgets.init = function() { connectWith: '.widget_column', handle: 'div.drag_handle', forcePlaceholderSize: true, - placeholder: 'widget_placeholder' + placeholder: 'widget_placeholder', + stop: function(event, ui) { + elgg.action('widgets/move', { + data: { + // widget_ + guid: ui.item.attr('id').substring(7), + // widget_col_ + column: ui.item.parent().attr('id').substring(11), + position: ui.item.index() + } + }); + } }); $('#widget_add_button a').bind('click', function(event) { @@ -33,7 +44,7 @@ elgg.ui.widgets.init = function() { // insert a widget into the layout elgg.ui.widgets.insert = function(html) { - $('.widget_col_1').prepend(html); + $('#widget_col_1').prepend(html); } elgg.ui.widgets.equalHeight = function(selector) { -- cgit v1.2.3