From acb1514137c7290bb20e4c70a66cad89b2a51d5e Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 2 Jan 2009 19:53:38 +0000 Subject: [PATCH] make sync-style the default for pcrud, use {async:true} to go async git-svn-id: svn://svn.open-ils.org/ILS/trunk@11727 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/PermaCrud.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Open-ILS/web/js/dojo/openils/PermaCrud.js b/Open-ILS/web/js/dojo/openils/PermaCrud.js index f89ba3c8d7..5c0010622b 100644 --- a/Open-ILS/web/js/dojo/openils/PermaCrud.js +++ b/Open-ILS/web/js/dojo/openils/PermaCrud.js @@ -74,9 +74,12 @@ if(!dojo._hasResource["openils.PermaCrud"]) { } ); + 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 @@ if(!dojo._hasResource["openils.PermaCrud"]) { req.send(); + if (req_hash.timeout) return req.result.content(); return req; }, @@ -105,6 +109,8 @@ if(!dojo._hasResource["openils.PermaCrud"]) { } ); + if (!opts.async && !opts.timeout) req_hash.timeout = 10; + var _pcrud = this; var req = this.session.request( req_hash ); @@ -116,6 +122,7 @@ if(!dojo._hasResource["openils.PermaCrud"]) { req.send(); + if (req_hash.timeout) return req.result.content(); return req; }, @@ -131,6 +138,8 @@ if(!dojo._hasResource["openils.PermaCrud"]) { } ); + if (!opts.async && !opts.timeout) req_hash.timeout = 10; + var _pcrud = this; var req = this.session.request( req_hash ); @@ -142,6 +151,7 @@ if(!dojo._hasResource["openils.PermaCrud"]) { req.send(); + if (req_hash.timeout) return req.result.content(); return req; }, -- 2.11.0