[open-ils-commits] r16281 - in trunk/Open-ILS/xul/staff_client: chrome/content/OpenILS chrome/content/main server/main (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Apr 20 12:25:51 EDT 2010
Author: phasefx
Date: 2010-04-20 12:25:48 -0400 (Tue, 20 Apr 2010)
New Revision: 16281
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js
trunk/Open-ILS/xul/staff_client/server/main/data.xul
Log:
toward a singleton for OpenILS.data
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2010-04-20 15:19:18 UTC (rev 16280)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2010-04-20 16:25:48 UTC (rev 16281)
@@ -4,6 +4,10 @@
OpenILS.data = function () {
try {
+ /* We're going to turn this guy into a singleton, at least for a given window, and look for it in xulG */
+ if (! window.xulG) { window.xulG = {}; }
+ if (window.xulG._data) { return window.xulG._data; }
+
JSAN.use('util.error'); this.error = new util.error();
JSAN.use('util.network'); this.network = new util.network();
} catch(E) {
@@ -11,6 +15,7 @@
throw(E);
}
+ window.xulG._data = this;
return this;
}
@@ -231,10 +236,6 @@
this.error.sdump('D_DATA_RETRIEVE','Retrieving ' + i + ' : ' + dc[i] + '\n');
this[i] = dc[i];
}
- if (typeof this.on_complete == 'function') {
-
- this.on_complete();
- }
} catch(E) {
this.error.sdump('D_ERROR','Error in OpenILS.data._debug_stash(): ' + js2JSON(E) );
}
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js 2010-04-20 15:19:18 UTC (rev 16280)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/menu.js 2010-04-20 16:25:48 UTC (rev 16281)
@@ -11,6 +11,7 @@
JSAN.use('util.error'); this.error = new util.error();
JSAN.use('util.window'); this.window = new util.window();
JSAN.use('util.sound'); this.sound = new util.sound();
+ JSAN.use('OpenILS.data'); this.data = new OpenILS.data(); this.data.init({'via':'stash'});
this.w = window;
var x = document.getElementById('network_progress');
@@ -62,8 +63,6 @@
var obj = this;
- JSAN.use('OpenILS.data'); obj.data = new OpenILS.data(); obj.data.init({'via':'stash'});
-
var button_bar = String( obj.data.hash.aous['ui.general.button_bar'] ) == 'true';
if (button_bar) {
var x = document.getElementById('main_toolbar');
@@ -1483,6 +1482,7 @@
};
content_params.chrome_xulG = xulG;
content_params._sound = xulG._sound;
+ content_params._data = xulG._data;
if (params && params.tab_name) content_params.set_tab_name( params.tab_name );
var frame;
Modified: trunk/Open-ILS/xul/staff_client/server/main/data.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/main/data.xul 2010-04-20 15:19:18 UTC (rev 16280)
+++ trunk/Open-ILS/xul/staff_client/server/main/data.xul 2010-04-20 16:25:48 UTC (rev 16281)
@@ -204,7 +204,7 @@
g.data.on_complete = function () {
try {
-
+ g.data.on_complete = null;
g.data.stash('list','hash','tree','temp');
g.data._debug_stash();
More information about the open-ils-commits
mailing list