From 8f175fb48e3e748fae0003214a1eabbb296c19e5 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 24 Jun 2008 10:17:19 +0000 Subject: Widgets now reload properly git-svn-id: https://code.elgg.org/elgg/trunk@1089 36083f99-b078-4883-b0ff-0f9b5a30f544 --- _graphics/ajax-loader.gif | Bin 4421 -> 0 bytes _graphics/ajax_loader.gif | Bin 0 -> 4421 bytes views/default/widgets/editwrapper.php | 5 ++++- views/default/widgets/wrapper.php | 27 +++++++++++++++++++++++++-- 4 files changed, 29 insertions(+), 3 deletions(-) delete mode 100644 _graphics/ajax-loader.gif create mode 100644 _graphics/ajax_loader.gif diff --git a/_graphics/ajax-loader.gif b/_graphics/ajax-loader.gif deleted file mode 100644 index 5a9af96d2..000000000 Binary files a/_graphics/ajax-loader.gif and /dev/null differ diff --git a/_graphics/ajax_loader.gif b/_graphics/ajax_loader.gif new file mode 100644 index 000000000..5a9af96d2 Binary files /dev/null and b/_graphics/ajax_loader.gif differ diff --git a/views/default/widgets/editwrapper.php b/views/default/widgets/editwrapper.php index a01f18310..bc7d497d9 100644 --- a/views/default/widgets/editwrapper.php +++ b/views/default/widgets/editwrapper.php @@ -47,10 +47,13 @@ $(document).ready(function() { $("#submit").attr("disabled","disabled"); $("#submit").attr("value",""); + $("#widgetcontent").html(' true)); ?>'); var variables = $("#widgetform").serialize(); $.post($("#widgetform").attr("action"),variables,function() { - $("#widget").load("pg/view/?shell=no&username=username; ?>&context="); + $("#submit").attr("disabled",""); + $("#submit").attr("value",""); + $("#widgetcontent").load("pg/view/?shell=no&username=username; ?>&context=&callback=true"); }); return false; diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php index dfb8b2279..6e3e26e5d 100644 --- a/views/default/widgets/wrapper.php +++ b/views/default/widgets/wrapper.php @@ -12,6 +12,9 @@ */ static $widgettypes; + + $callback = get_input('callback'); + if (!isset($widgettypes)) $widgettypes = get_widget_types(); if ($vars['entity'] instanceof ElggObject && $vars['entity']->getSubtype() == 'widget') { @@ -22,6 +25,8 @@ $title = elgg_echo("error"); } + if ($callback != "true") { + ?>
@@ -51,7 +56,25 @@ ?>
- + getGUID()}\">"; + + echo elgg_view("widgets/{$handler}/view",$vars); + + echo "
"; + + if ($callback != "true") { + + ?>
- \ No newline at end of file + + + \ No newline at end of file -- cgit v1.2.3