Compare all docs savedPoints before window close

Now looping thru all instances and comparing savedPoints against
changeGeneration integers
If we find a non match, we have unsaved content
This commit is contained in:
Matt Pass
2013-09-25 09:54:03 +01:00
parent ee917776f0
commit f0e47e07bc

View File

@@ -37,8 +37,10 @@ if ($ICEcoder["checkUpdates"]) {
iceRoot = "<?php echo $ICEcoder['root']; ?>";
window.onbeforeunload = function() {
if (top.ICEcoder.changedContent.indexOf(1)>-1) {
return "You have some unsaved changes.";
for(var i=1;i<=ICEcoder.savedPoints.length;i++) {
if (ICEcoder.savedPoints[i-1]!=top.ICEcoder.getcMInstance(ICEcoder.cMInstances[i-1]).changeGeneration()) {
return "You have some unsaved changes.";
}
}
}
</script>