aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 02:12:32 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-19 02:12:32 +0000
commit373ff03a2b6315eea13a97065774972ad3713ab6 (patch)
treedf051d2a4c1d150fd75b2f3db2d4647a5e1ebda9 /js
parent06f0e7b1aa5f6fd393d9a0b580f94709e29e10df (diff)
downloadelgg-373ff03a2b6315eea13a97065774972ad3713ab6.tar.gz
elgg-373ff03a2b6315eea13a97065774972ad3713ab6.tar.bz2
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
Diffstat (limited to 'js')
-rw-r--r--js/lib/ui.widgets.js18
1 files changed, 12 insertions, 6 deletions
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('<input type="hidden" name="default_widgets" value="1">');
+ }
+
elgg.action('widgets/save', {
data: $(this).serialize(),
success: function(json) {