Merge pull request #681 from MITx/bug/kfiedler/empty-subtitle
fixed empty space below accordion nav items that dont have a subtitle
This commit is contained in:
@@ -125,8 +125,12 @@ section.course-index {
|
||||
font-weight: normal;
|
||||
display: block;
|
||||
margin: 0;
|
||||
|
||||
&:empty {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, .1);
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user