aboutsummaryrefslogtreecommitdiff
path: root/js/lib/ui.widgets.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/ui.widgets.js')
-rw-r--r--js/lib/ui.widgets.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js
index 6435d2147..47e43c876 100644
--- a/js/lib/ui.widgets.js
+++ b/js/lib/ui.widgets.js
@@ -107,7 +107,7 @@ elgg.ui.widgets.move = function(event, ui) {
* @return void
*/
elgg.ui.widgets.remove = function(event) {
- var $widget = $(this).parent().parent();
+ var $widget = $(this).closest('.elgg-module-widget');
// if widget type is single instance type, enable the add buton
var type = $widget.attr('class');
@@ -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();
};
@@ -196,7 +190,7 @@ elgg.ui.widgets.equalHeight = function(selector) {
maxHeight = $(this).height();
}
})
- $(selector).css('min-height', maxHeight);
+ $(selector).css('min-height', maxHeight + 'px');
};
elgg.register_hook_handler('init', 'system', elgg.ui.widgets.init);