Fixed issue where js would break on pages with no halftone blocks
authorDan Fuhry <dan@enanocms.org>
Tue, 27 Mar 2012 12:14:14 -0400
changeset 2 2f3b76a405ce
parent 1 87dfd1a261bd
child 3 c3150cee8dd9
Fixed issue where js would break on pages with no halftone blocks
Halftone.php
--- a/Halftone.php	Tue Mar 27 11:58:43 2012 -0400
+++ b/Halftone.php	Tue Mar 27 12:14:14 2012 -0400
@@ -277,7 +277,9 @@
 			<script type="text/javascript">
 				addOnloadHook(function()
 					{
-						$("div.halftone").get(0).style.pageBreakBefore = "auto";
+						var first_ht = $("div.halftone").get(0);
+						if ( first_ht )
+							first_ht.style.pageBreakBefore = "auto";
 						$("select.halftone-key").change(function()
 							{
 								var me = this;