[open-ils-commits] r9873 -
trunk/Open-ILS/xul/staff_client/chrome/content/cat
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jun 19 11:45:15 EDT 2008
Author: phasefx
Date: 2008-06-19 11:45:13 -0400 (Thu, 19 Jun 2008)
New Revision: 9873
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
Log:
This fixes one class of caching problems with the chrome OPAC wrapper (all the different staff views that hang off of the catalog)
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.js 2008-06-19 15:35:31 UTC (rev 9872)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.js 2008-06-19 15:45:13 UTC (rev 9873)
@@ -1,5 +1,10 @@
var docid; var marc_html; var top_pane; var bottom_pane; var opac_frame; var opac_url;
+var marc_view_reset = true;
+var marc_edit_reset = true;
+var copy_browser_reset = true;
+var hold_browser_reset = true;
+
function $(id) { return document.getElementById(id); }
function my_init() {
@@ -34,7 +39,7 @@
}
}
-function set_brief_view(reset) {
+function set_brief_view() {
var url = xulG.url_prefix( urls.XUL_BIB_BRIEF ) + '?docid=' + window.escape(docid);
dump('spawning ' + url + '\n');
top_pane.set_iframe(
@@ -52,16 +57,17 @@
);
}
-function set_marc_view(reset) {
+function set_marc_view() {
g.view = 'marc_view';
- if (reset) {
+ if (marc_view_reset) {
bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_MARC_VIEW ) + '?docid=' + window.escape(docid),{},xulG);
+ marc_view_reset = false;
} else {
bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_MARC_VIEW ) + '?docid=' + window.escape(docid),{},xulG);
}
}
-function set_marc_edit(reset) {
+function set_marc_edit() {
g.view = 'marc_edit';
var a = xulG.url_prefix( urls.XUL_MARC_EDIT );
var b = {};
@@ -83,32 +89,35 @@
}
}
};
- if (reset) {
+ if (marc_edit_reset) {
bottom_pane.reset_iframe( a,b,c );
+ marc_edit_reset = false;
} else {
bottom_pane.set_iframe( a,b,c );
}
}
-function set_copy_browser(reset) {
+function set_copy_browser() {
g.view = 'copy_browser';
- if (reset) {
+ if (copy_browser_reset) {
bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_COPY_VOLUME_BROWSE ) + '?docid=' + window.escape(docid),{},xulG);
+ copy_browser_reset =false;
} else {
bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_COPY_VOLUME_BROWSE ) + '?docid=' + window.escape(docid),{},xulG);
}
}
-function set_hold_browser(reset) {
+function set_hold_browser() {
g.view = 'hold_browser';
- if (reset) {
+ if (hold_browser_reset) {
bottom_pane.reset_iframe( xulG.url_prefix( urls.XUL_HOLDS_BROWSER ) + '?docid=' + window.escape(docid),{},xulG);
+ hold_browser_reset = false;
} else {
bottom_pane.set_iframe( xulG.url_prefix( urls.XUL_HOLDS_BROWSER ) + '?docid=' + window.escape(docid),{},xulG);
}
}
-function set_opac(reset) {
+function set_opac() {
g.view = 'opac';
try {
var content_params = {
@@ -143,7 +152,7 @@
try {
if (docid == id) return;
docid = id;
- refresh_display(id,true);
+ refresh_display(id);
} catch(E) {
g.error.standard_unexpected_error_alert('rdetail -> recordRetrieved',E);
}
@@ -243,7 +252,7 @@
alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_deleted.error', [docid, robj.textcode, robj.desc]) + '\n');
} else {
alert(document.getElementById('offlineStrings').getString('cat.opac.record_deleted'));
- refresh_display(docid,true);
+ refresh_display(docid);
}
}
}
@@ -262,20 +271,24 @@
alert(document.getElementById('offlineStrings').getFormattedString('cat.opac.record_undeleted.error', [docid, robj.textcode, robj.desc]) + '\n');
} else {
alert(document.getElementById('offlineStrings').getString('cat.opac.record_undeleted'));
- refresh_display(docid,true);
+ refresh_display(docid);
}
}
}
-function refresh_display(id,reset) {
+function refresh_display(id) {
try {
+ marc_view_reset = true;
+ marc_edit_reset = true;
+ copy_browser_reset = true;
+ hold_browser_reset = true;
while(top_pane.node.lastChild) top_pane.node.removeChild( top_pane.node.lastChild );
var children = bottom_pane.node.childNodes;
for (var i = 0; i < children.length; i++) {
if (children[i] != browser_frame) bottom_pane.node.removeChild(children[i]);
}
- set_brief_view(reset);
+ set_brief_view();
$('nav').setAttribute('hidden','false');
var settings = g.network.simple_request(
'FM_AUS_RETRIEVE',
@@ -287,12 +300,12 @@
g.view_override = null;
}
switch(view) {
- case 'marc_view' : set_marc_view(reset); break;
- case 'marc_edit' : set_marc_edit(reset); break;
- case 'copy_browser' : set_copy_browser(reset); break;
- case 'hold_browser' : set_hold_browser(reset); break;
+ case 'marc_view' : set_marc_view(); break;
+ case 'marc_edit' : set_marc_edit(); break;
+ case 'copy_browser' : set_copy_browser(); break;
+ case 'hold_browser' : set_hold_browser(); break;
case 'opac' :
- default: set_opac(reset); break;
+ default: set_opac(); break;
}
} catch(E) {
g.error.standard_unexpected_error_alert('in refresh_display',E);
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul 2008-06-19 15:35:31 UTC (rev 9872)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul 2008-06-19 15:45:13 UTC (rev 9873)
@@ -59,7 +59,7 @@
<menuitem label="&staff.cat.opac.remove_me.label;" id="remove_me" oncommand="remove_me();"/>
<menuseparator/>
<menuitem label="&staff.cat.opac.default.label;" id="default" oncommand="set_default();"/>
- <menuitem label="&staff.cat.opac.refresh_me.label;" id="refresh_me" oncommand="refresh_display(docid,true);"/>
+ <menuitem label="&staff.cat.opac.refresh_me.label;" id="refresh_me" oncommand="refresh_display(docid);"/>
</menupopup>
</menu>
</menubar>
More information about the open-ils-commits
mailing list