diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-19 03:28:41 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-11-19 03:28:41 +0000 |
commit | 4dc9076224a0d93f0dc078124aa9fb94a669f16c (patch) | |
tree | c4fb116cfab0dab64f92e3183012515322b04b30 /js | |
parent | 28a52ae81a78bff05d864dce226d3b1a9517a8c3 (diff) | |
download | elgg-4dc9076224a0d93f0dc078124aa9fb94a669f16c.tar.gz elgg-4dc9076224a0d93f0dc078124aa9fb94a669f16c.tar.bz2 |
saving widget position after moving
git-svn-id: http://code.elgg.org/elgg/trunk@7343 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'js')
-rw-r--r-- | js/lib/ui.widgets.js | 15 |
1 files changed, 13 insertions, 2 deletions
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>
+ guid: ui.item.attr('id').substring(7),
+ // widget_col_<column>
+ 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) {
|