From c17a9b78f8c86b59b9eb0944198cfdc8073a846b Mon Sep 17 00:00:00 2001 From: Kyle Fiedler Date: Thu, 13 Sep 2012 13:52:47 -0400 Subject: [PATCH] fixed empty space below accordion nav items that dont have a subtitle --- lms/static/sass/course/courseware/_sidebar.scss | 6 +++++- lms/templates/courseware/courseware.html | 16 +++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lms/static/sass/course/courseware/_sidebar.scss b/lms/static/sass/course/courseware/_sidebar.scss index 8ce963fd5f..4e893d2455 100644 --- a/lms/static/sass/course/courseware/_sidebar.scss +++ b/lms/static/sass/course/courseware/_sidebar.scss @@ -125,8 +125,12 @@ section.course-index { font-weight: normal; display: block; margin: 0; + + &:empty { + display: none; + } } - } + } &:hover { background: rgba(0, 0, 0, .1); diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index a446460d36..9c0ad9dd99 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -41,15 +41,17 @@ $(".ui-accordion-header a, .ui-accordion-content .subtitle").each(function() { var wordArray = $(this).text().split(" "); var finalTitle = ""; - for (i=0;i<=wordArray.length-1;i++) { - finalTitle += wordArray[i]; - if (i == (wordArray.length-2)) { - finalTitle += " "; - } else { - finalTitle += " "; + if (wordArray.isEmptyObject()) { + for (i=0;i<=wordArray.length-1;i++) { + finalTitle += wordArray[i]; + if (i == (wordArray.length-2)) { + finalTitle += " "; + } else { + finalTitle += " "; + } } + $(this).html(finalTitle); } - $(this).html(finalTitle); }); });