mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-02 23:03:59 +01:00
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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user