diff core.js @ 473:5bd699bc44d2 Dev_main

popup resize not called if not created. Horizontal sliders resize on window resize function.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Wed, 13 Jan 2016 14:02:00 +0000
parents 23f77550b842
children 63461187a425
line wrap: on
line diff
--- a/core.js	Wed Jan 13 12:27:38 2016 +0000
+++ b/core.js	Wed Jan 13 14:02:00 2016 +0000
@@ -664,11 +664,13 @@
 	this.resize = function(event)
 	{
 		// Called on window resize;
-		this.popup.style.left = (window.innerWidth/2)-250 + 'px';
-		this.popup.style.top = (window.innerHeight/2)-125 + 'px';
-		var blank = document.getElementsByClassName('testHalt')[0];
-		blank.style.width = window.innerWidth;
-		blank.style.height = window.innerHeight;
+		if (this.popup != null) {
+			this.popup.style.left = (window.innerWidth/2)-250 + 'px';
+			this.popup.style.top = (window.innerHeight/2)-125 + 'px';
+			var blank = document.getElementsByClassName('testHalt')[0];
+			blank.style.width = window.innerWidth;
+			blank.style.height = window.innerHeight;
+		}
 	};
 }