diff options
author | Cash Costello <cash.costello@gmail.com> | 2011-12-07 07:21:59 -0500 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2011-12-07 07:21:59 -0500 |
commit | f0b45d1f1982cd716b9a536cfca16157bafa86c3 (patch) | |
tree | 49b24a4b64c3c79f1adfe969233cf3fb3e7b20f3 /js | |
parent | c99531fecbdbefe8434d83a081dfd3d360554a23 (diff) | |
download | elgg-f0b45d1f1982cd716b9a536cfca16157bafa86c3.tar.gz elgg-f0b45d1f1982cd716b9a536cfca16157bafa86c3.tar.bz2 |
simplified the JavaScript for deleteing a widget
Diffstat (limited to 'js')
-rw-r--r-- | js/lib/ui.widgets.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js index 6435d2147..f12ae02c1 100644 --- a/js/lib/ui.widgets.js +++ b/js/lib/ui.widgets.js @@ -124,15 +124,9 @@ elgg.ui.widgets.remove = function(event) { $widget.remove(); - // elgg-widget-delete-button-<guid> - var id = $(this).attr('id'); - id = id.substr(id.indexOf('elgg-widget-delete-button-') + "elgg-widget-delete-button-".length); + // delete the widget through ajax + elgg.action($(this).attr('href')); - elgg.action('widgets/delete', { - data: { - widget_guid: id - } - }); event.preventDefault(); }; |