From a0e98d5957e162bcec84fdbbe7d5368ac6386974 Mon Sep 17 00:00:00 2001 From: Timothy Fike Date: Tue, 10 Feb 2015 19:47:06 -0500 Subject: [PATCH] Make widget headers clickable anywhere. --- public/src/admin/extend/widgets.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/src/admin/extend/widgets.js b/public/src/admin/extend/widgets.js index 1bf4a043ec..9632bbfa68 100644 --- a/public/src/admin/extend/widgets.js +++ b/public/src/admin/extend/widgets.js @@ -46,8 +46,6 @@ define('admin/extend/widgets', function() { appendToggle(ui.item); }, connectWith: "div" - }).on('click', '.toggle-widget', function() { - $(this).parents('.widget-panel').children('.panel-body').toggleClass('hidden'); }).on('click', '.delete-widget', function() { var panel = $(this).parents('.widget-panel'); @@ -56,8 +54,10 @@ define('admin/extend/widgets', function() { panel.remove(); } }); - }).on('dblclick', '.panel-heading', function() { - $(this).parents('.widget-panel').children('.panel-body').toggleClass('hidden'); + }).on('mouseup', '.panel-heading', function(evt) { + if ( !( $(this).parents('.widget-panel').is('.ui-sortable-helper') || $(evt.target).closest('.delete-widget').length ) ) { + $(this).parents('.widget-panel').children('.panel-body').toggleClass('hidden'); + } }); $('#widgets .save').on('click', saveWidgets);