From a40e8eaefbb73544c7033a9f85b1d6cc5abe3a54 Mon Sep 17 00:00:00 2001 From: kimth Date: Thu, 13 Sep 2012 18:10:11 -0400 Subject: [PATCH] Clean up widow prevention logic --- lms/templates/courseware/courseware.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index ee6460ffec..761237fd76 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -42,11 +42,13 @@ var elemText = $(this).text().replace(/^\s+|\s+$/g,''); // Strip leading and trailing whitespace var wordArray = elemText.split(" "); var finalTitle = ""; - if (!($.isEmptyObject(wordArray))) { + if (wordArray.length > 0) { for (i=0;i<=wordArray.length-1;i++) { finalTitle += wordArray[i]; if (i == (wordArray.length-2)) { finalTitle += " "; + } else if (i == (wordArray.length-1)) { + // Do nothing } else { finalTitle += " "; }