[open-ils-commits] r11727 - trunk/Open-ILS/web/js/dojo/openils

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jan 2 14:53:42 EST 2009


Author: miker
Date: 2009-01-02 14:53:38 -0500 (Fri, 02 Jan 2009)
New Revision: 11727

Modified:
   trunk/Open-ILS/web/js/dojo/openils/PermaCrud.js
Log:
make sync-style the default for pcrud, use {async:true} to go async

Modified: trunk/Open-ILS/web/js/dojo/openils/PermaCrud.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/PermaCrud.js	2009-01-02 19:14:26 UTC (rev 11726)
+++ trunk/Open-ILS/web/js/dojo/openils/PermaCrud.js	2009-01-02 19:53:38 UTC (rev 11727)
@@ -74,9 +74,12 @@
                 }
             );
 
+            if (!opts.async && !opts.timeout) req_hash.timeout = 10;
+
             var _pcrud = this;
             var req = this.session.request( req_hash );
 
+
             if (!req.onerror)
                 req.onerror = function (r) { throw js2JSON(r); };
 
@@ -85,6 +88,7 @@
 
             req.send();
 
+            if (req_hash.timeout) return req.result.content();
             return req;
         },
 
@@ -105,6 +109,8 @@
                 }
             );
 
+            if (!opts.async && !opts.timeout) req_hash.timeout = 10;
+
             var _pcrud = this;
             var req = this.session.request( req_hash );
 
@@ -116,6 +122,7 @@
 
             req.send();
 
+            if (req_hash.timeout) return req.result.content();
             return req;
         },
 
@@ -131,6 +138,8 @@
                 }
             );
 
+            if (!opts.async && !opts.timeout) req_hash.timeout = 10;
+
             var _pcrud = this;
             var req = this.session.request( req_hash );
 
@@ -142,6 +151,7 @@
 
             req.send();
 
+            if (req_hash.timeout) return req.result.content();
             return req;
         },
 



More information about the open-ils-commits mailing list