Commit 5dbc0b7e by kimth

Fix widow prevent logic

parent cf9130a8
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
$(function(){ $(function(){
$(".ui-accordion-header a, .ui-accordion-content .subtitle").each(function() { $(".ui-accordion-header a, .ui-accordion-content .subtitle").each(function() {
var wordArray = $(this).text().split(" "); var elemText = $(this).text().replace(/^\s+|\s+$/g,''); // Strip leading and trailing whitespace
var wordArray = elemText.split(" ");
var finalTitle = ""; var finalTitle = "";
if (!($.isEmptyObject(wordArray))) { if (!($.isEmptyObject(wordArray))) {
for (i=0;i<=wordArray.length-1;i++) { for (i=0;i<=wordArray.length-1;i++) {
...@@ -50,8 +51,8 @@ ...@@ -50,8 +51,8 @@
finalTitle += " "; finalTitle += " ";
} }
} }
$(this).html(finalTitle);
} }
$(this).html(finalTitle);
}); });
}); });
</script> </script>
......
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