diff --git a/js/qubit.js b/js/qubit.js index f51ee33613..9644e62c36 100644 --- a/js/qubit.js +++ b/js/qubit.js @@ -17,14 +17,19 @@ window.log = function() Drupal.behaviors.expander = { attach: function (context) { - jQuery('div.field:not(:has(div.field)) > div:not(:has(ul, li))') - .expander({ - slicePoint: 255, - expandText: '»', - expandPrefix: '... ', - userCollapseText: '«', - widow: 4, - expandEffect: 'show' - }); + jQuery('div.field:not(:has(div.field)) > div').each(function (index, element) { + var $element = jQuery(element); + // Don't apply expander to fields with only one child, if that child is a list + if ($element.children().length !== 1 || !$element.children().first().is('ul')) { + $element.expander({ + slicePoint: 255, + expandText: '»', + expandPrefix: '... ', + userCollapseText: '«', + widow: 4, + expandEffect: 'show' + }); + } + }); } };