Fix not being able to expand an empty subsection.

This commit is contained in:
Peter Fogg
2013-08-09 17:03:50 -04:00
committed by cahrens
parent cbd066da04
commit 7640ade481

View File

@@ -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'