[open-ils-commits] r9353 - trunk/Open-ILS/web/js/dojo/openils
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Apr 14 16:59:50 EDT 2008
Author: erickson
Date: 2008-04-14 16:21:49 -0400 (Mon, 14 Apr 2008)
New Revision: 9353
Modified:
trunk/Open-ILS/web/js/dojo/openils/User.js
Log:
added a synchronous option to user session fetching
Modified: trunk/Open-ILS/web/js/dojo/openils/User.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/User.js 2008-04-14 19:03:36 UTC (rev 9352)
+++ trunk/Open-ILS/web/js/dojo/openils/User.js 2008-04-14 20:21:49 UTC (rev 9353)
@@ -30,13 +30,19 @@
openils.User.getBySession = function(onComplete) {
var req = ses.request('open-ils.auth.session.retrieve', openils.User.authtoken);
- req.oncomplete = function(r) {
- var user = r.recv().content();
- openils.User.user = user;
- if(onComplete)
- onComplete(user);
+ if(onComplete) {
+ req.oncomplete = function(r) {
+ var user = r.recv().content();
+ openils.User.user = user;
+ if(onComplete)
+ onComplete(user);
+ }
+ req.send();
+ } else {
+ req.timeout = 10;
+ req.send();
+ return openils.User.user = req.recv().content();
}
- req.send();
}
openils.User.getById = function(id, onComplete) {
More information about the open-ils-commits
mailing list