Author: michiel
Date: 2010-04-22 17:33:17 +0200 (Thu, 22 Apr 2010)
New Revision: 42016
Modified:
mmbase/trunk/applications/searchrelate/src/main/webapp/mmbase/searchrelate/List.js.jsp
Log:
ported entire thing from 1.9
Modified:
mmbase/trunk/applications/searchrelate/src/main/webapp/mmbase/searchrelate/List.js.jsp
===================================================================
---
mmbase/trunk/applications/searchrelate/src/main/webapp/mmbase/searchrelate/List.js.jsp
2010-04-22 15:31:42 UTC (rev 42015)
+++
mmbase/trunk/applications/searchrelate/src/main/webapp/mmbase/searchrelate/List.js.jsp
2010-04-22 15:33:17 UTC (rev 42016)
@@ -224,13 +224,13 @@
$(window).bind("beforeunload",
function(ev) {
List.prototype.leftPage = true;
+ $(self.div).find(":input").attr("disabled", true);
var result = self.commit(0, true);
if (result != null) {
ev.returnValue = confirm(result); //'<fmt:message
key="invalid" />';
return ev.returnValue;
}
return result == null ? undefined : result; // IE want
'undefined' to avoid the popup
-
});
// automaticly make the entries empty on focus if they evidently contain
the default value only
this.find("mm_validate", "input").filter(function() {
@@ -799,9 +799,20 @@
result = null;
}
if (leavePage) {
- if (self.saving) {
- return "Cannot leave because still saving " + result;
- }
+
+ // put a maximum on the duration time of the next while loop. Just to
be sure.
+ $.timer(10000,
+ function(timer) {
+ self.saving = false;
+ timer.stop();
+ }
+ );
+
+ while(self.saving) {
+ // waiting a bit for that.
+ // There is no proper wait or join method in javascript.
+ }
+
if (result != null) {
return "Cannot leave because save failed: " + result;
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs