changeset 923:7a7a72880996

Merge from the default branch
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Tue, 02 Jun 2015 11:24:23 +0100
parents 95ff666edb66
children 2dc00907c6ab
files core.js
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/core.js	Mon Jun 01 15:26:58 2015 +0100
+++ b/core.js	Tue Jun 02 11:24:23 2015 +0100
@@ -378,10 +378,13 @@
 			console.log('Error saving file to server! Presenting download locally');
 			createProjectSave(null);
 		};
+		xmlhttp.onreadystatechange  = function() {
+			console.log(xmlhttp.status);
+			if (xmlhttp.status != 200 && xmlhttp.readyState == 4) {
+				createProjectSave(null);
+			}
+		};
 		xmlhttp.send(file);
-		if (xmlhttp.status == 404) {
-			createProjectSave(null);
-		}
 	}
 	return submitDiv;
 }