Commit a40e8eae by kimth

Clean up widow prevention logic

parent 5dbc0b7e
...@@ -42,11 +42,13 @@ ...@@ -42,11 +42,13 @@
var elemText = $(this).text().replace(/^\s+|\s+$/g,''); // Strip leading and trailing whitespace var elemText = $(this).text().replace(/^\s+|\s+$/g,''); // Strip leading and trailing whitespace
var wordArray = elemText.split(" "); var wordArray = elemText.split(" ");
var finalTitle = ""; var finalTitle = "";
if (!($.isEmptyObject(wordArray))) { if (wordArray.length > 0) {
for (i=0;i<=wordArray.length-1;i++) { for (i=0;i<=wordArray.length-1;i++) {
finalTitle += wordArray[i]; finalTitle += wordArray[i];
if (i == (wordArray.length-2)) { if (i == (wordArray.length-2)) {
finalTitle += "&nbsp;"; finalTitle += "&nbsp;";
} else if (i == (wordArray.length-1)) {
// Do nothing
} else { } else {
finalTitle += " "; finalTitle += " ";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment