From 47f57504bdfb43d0672e811f91a6412ce77cbb29 Mon Sep 17 00:00:00 2001 From: Geert De Deckere Date: Thu, 15 Mar 2012 14:20:44 +0100 Subject: [PATCH] Smarter toggling of the metabox for variations --- assets/js/admin/write-panels.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/js/admin/write-panels.js b/assets/js/admin/write-panels.js index 56a9a13641d..ba6a650c2d1 100644 --- a/assets/js/admin/write-panels.js +++ b/assets/js/admin/write-panels.js @@ -568,7 +568,10 @@ jQuery( function($){ }); // Open/close - jQuery('.wc-metaboxes-wrapper').on('click', '.wc-metabox h3', function(){ + jQuery('.wc-metaboxes-wrapper').on('click', '.wc-metabox h3', function(event){ + // If the user clicks on some form input inside the h3, like a select list (for variations), the box should not be toggled + if ($(event.target).is(':input')) return; + jQuery(this).next('.wc-metabox-content').toggle(); });