aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/editwrapper.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-23 17:23:30 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-23 17:23:30 +0000
commit982389815df230607100c9ee2ec1c40583026e4b (patch)
treee485b12d4412d6430bf03d06f5b4dd3146e5f379 /views/default/widgets/editwrapper.php
parent2dad5867569b3b30920220c8ed1edd912b55811c (diff)
downloadelgg-982389815df230607100c9ee2ec1c40583026e4b.tar.gz
elgg-982389815df230607100c9ee2ec1c40583026e4b.tar.bz2
Widgets now save on a per-widget basis. TODO: get the collapsing widgets to work once they've saved ..
git-svn-id: https://code.elgg.org/elgg/trunk@1073 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/widgets/editwrapper.php')
-rw-r--r--views/default/widgets/editwrapper.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/views/default/widgets/editwrapper.php b/views/default/widgets/editwrapper.php
index 2914068fe..ad8c90b2a 100644
--- a/views/default/widgets/editwrapper.php
+++ b/views/default/widgets/editwrapper.php
@@ -13,7 +13,7 @@
?>
-<form action="<?php echo $vars['url']; ?>action/widgets/save" method="post">
+<form id="widgetform<?php echo $vars['entity']->getGUID(); ?>" action="<?php echo $vars['url']; ?>action/widgets/save" method="post">
<?php
@@ -36,4 +36,20 @@
?>" />
</p>
-</form> \ No newline at end of file
+</form>
+
+<script type="text/javascript">
+$(document).ready(function() {
+
+ $("#widgetform<?php echo $vars['entity']->getGUID(); ?>").submit(function () {
+
+ var variables = $("#widgetform<?php echo $vars['entity']->getGUID(); ?>").serialize();
+ $.post($("#widgetform<?php echo $vars['entity']->getGUID(); ?>").attr("action"),variables,function() {
+ $("#widget<?php echo $vars['entity']->getGUID(); ?>").load("<?php echo $vars['url']; ?>pg/view/<?php echo $vars['entity']->getGUID(); ?>?shell=no&username=<?php echo page_owner_entity()->username; ?>&context=<?php echo get_context(); ?>");
+ });
+ return false;
+
+ });
+
+});
+</script> \ No newline at end of file