[open-ils-commits] r9871 -
branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/cat
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jun 19 11:34:08 EDT 2008
Author: phasefx
Date: 2008-06-19 11:34:01 -0400 (Thu, 19 Jun 2008)
New Revision: 9871
Modified:
branches/rel_1_2/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: branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
===================================================================
--- branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul 2008-06-19 15:30:35 UTC (rev 9870)
+++ branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/cat/opac.xul 2008-06-19 15:34:01 UTC (rev 9871)
@@ -33,6 +33,11 @@
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() {
@@ -68,10 +73,10 @@
}
}
- 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(
+ top_pane.reset_iframe(
url,
{},
{
@@ -86,16 +91,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 = {};
@@ -117,32 +123,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 = {
@@ -177,7 +186,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);
}
@@ -270,7 +279,7 @@
if (typeof robj.ilsevent != 'undefined') {
alert('Error deleting Record #' + docid + ' : ' + robj.textcode + ' : ' + robj.desc + '\n');
} else {
- alert('Record deleted.'); refresh_display(docid,true);
+ alert('Record deleted.'); refresh_display(docid);
}
}
}
@@ -281,20 +290,24 @@
if (typeof robj.ilsevent != 'undefined') {
alert('Error undeleting Record #' + docid + ' : ' + robj.textcode + ' : ' + robj.desc + '\n');
} else {
- alert('Record undeleted.'); refresh_display(docid,true);
+ alert('Record undeleted.'); 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',
@@ -306,12 +319,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);
@@ -358,7 +371,7 @@
<menuitem label="Remove this Frame" id="remove_me" oncommand="remove_me();"/>
<menuseparator/>
<menuitem label="Set bottom interface as Default" id="default" oncommand="set_default();"/>
- <menuitem label="Reset Display" id="refresh_me" oncommand="refresh_display(docid,true);"/>
+ <menuitem label="Reset Display" id="refresh_me" oncommand="refresh_display(docid);"/>
</menupopup>
</menu>
</menubar>
More information about the open-ils-commits
mailing list