From 373ff03a2b6315eea13a97065774972ad3713ab6 Mon Sep 17 00:00:00 2001 From: brettp Date: Sat, 19 Feb 2011 02:12:32 +0000 Subject: Fixes #2753: Default widgets merged into core as extensible admin section and updated to work with new widgets. Will need an upgrade for users running the old default widgets in 1.7. git-svn-id: http://code.elgg.org/elgg/trunk@8302 36083f99-b078-4883-b0ff-0f9b5a30f544 --- js/lib/ui.widgets.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'js/lib/ui.widgets.js') diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js index b6e81617a..1acc22928 100644 --- a/js/lib/ui.widgets.js +++ b/js/lib/ui.widgets.js @@ -56,8 +56,9 @@ elgg.ui.widgets.add = function(event) { elgg.action('widgets/add', { data: { handler: type, - user_guid: elgg.get_logged_in_user_guid(), - context: $("input[name='widget_context']").val() + owner_guid: elgg.get_page_owner_guid(), + context: $("input[name='widget_context']").val(), + default_widgets: $("input[name='default_widgets']").val() || 0 }, success: function(json) { $('#elgg-widget-col-1').prepend(json.output); @@ -86,7 +87,7 @@ elgg.ui.widgets.move = function(event, ui) { elgg.action('widgets/move', { data: { - guid: guidString, + widget_guid: guidString, column: col, position: ui.item.index() } @@ -129,7 +130,7 @@ elgg.ui.widgets.remove = function(event) { elgg.action('widgets/delete', { data: { - guid: id + widget_guid: id } }); event.preventDefault(); @@ -158,13 +159,18 @@ elgg.ui.widgets.collapseToggle = function(event) { elgg.ui.widgets.saveSettings = function(event) { $(this).parent().slideToggle('medium'); var $widgetContent = $(this).parent().parent().children('.elgg-widget-content'); - - // stick the ajaxk loader in there + + // stick the ajax loader in there var $loader = $('#elgg-widget-loader').clone(); $loader.attr('id', '#elgg-widget-active-loader'); $loader.removeClass('hidden'); $widgetContent.html($loader); + var default_widgets = $("input[name='default_widgets']").val() || 0; + if (default_widgets) { + $(this).append(''); + } + elgg.action('widgets/save', { data: $(this).serialize(), success: function(json) { -- cgit v1.2.3