From 7640ade481171cbaa4cea666ec395b5d0dd54c9b Mon Sep 17 00:00:00 2001 From: Peter Fogg Date: Fri, 9 Aug 2013 17:03:50 -0400 Subject: [PATCH] Fix not being able to expand an empty subsection. --- cms/static/js/views/overview.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cms/static/js/views/overview.js b/cms/static/js/views/overview.js index 2dbed015c4..7bfaa8dbea 100644 --- a/cms/static/js/views/overview.js +++ b/cms/static/js/views/overview.js @@ -33,9 +33,14 @@ $(document).ready(function() { } // Otherwise, do check the container else { - // If the list is empty, we should prepend to it + // If the list is empty, we should prepend to it, + // unless both elements are at the same location -- + // this prevents the user from being unable to expand + // a section + var containerY = container.offset().top; if(siblings.length == 0 && - Math.abs(eleY - container.offset().top) < 50) { + containerY != eleY && + Math.abs(eleY - containerY) < 50) { return { ele: container, attachMethod: 'prepend'