-var docid; var marc_html; var top_pane; var bottom_pane; var opac_frame; var opac_url;
+var docid; var marc_html; var top_pane; var bottom_pane; var opac_browser; var opac_url;
var marc_view_reset = true;
var marc_edit_reset = true;
"set_patron_tab", "volume_item_creator", "get_new_session",
"holdings_maintenance_tab", "open_chrome_window", "url_prefix",
"network_meter", "page_meter", "set_statusbar", "set_help_context",
- "get_barcode"
+ "get_barcode", "reload_opac"
].forEach(function(k) { content_params[k] = xulG[k]; });
top_pane.set_iframe(
);
} else {
- return cat.util.spawn_copy_editor( { 'handle_update' : 1, 'edit' : 1, 'docid' : doc_id, 'copies' : [ copy_obj ] });
+ var x = cat.util.spawn_copy_editor( { 'handle_update' : 1, 'edit' : 1, 'docid' : doc_id, 'copies' : [ copy_obj ] });
+ xulG.reload_opac();
+ return x;
}
} catch(E) {
marc_view_reset = true;
copy_browser_reset = true;
hold_browser_reset = true;
+ xulG.reload_opac();
if (typeof r.ilsevent != 'undefined') {
throw(r);
} else {
"set_patron_tab", "volume_item_creator", "get_new_session",
"holdings_maintenance_tab", "set_tab_name", "open_chrome_window",
"url_prefix", "network_meter", "page_meter", "set_statusbar",
- "set_help_context", "get_barcode"
+ "set_help_context", "get_barcode", "reload_opac"
].forEach(function(k) { content_params[k] = xulG[k]; });
var loc = urls.XUL_BROWSER + "?url=" + window.escape(
"set_patron_tab", "volume_item_creator", "get_new_session",
"holdings_maintenance_tab", "set_tab_name", "open_chrome_window",
"url_prefix", "network_meter", "page_meter", "set_statusbar",
- "set_help_context", "get_barcode"
+ "set_help_context", "get_barcode", "reload_opac"
].forEach(function(k) { content_params[k] = xulG[k]; });
var loc = urls.XUL_BROWSER + "?url=" + window.escape(
} catch(E) {
g.error.sdump('D_ERROR','set_opac: ' + E);
}
- opac_wrapper_set_help_context();
- bottom_pane.get_contentWindow().addEventListener('load',opac_wrapper_set_help_context,false);
+ opac_wrapper_set_help_context();
+ opac_browser = bottom_pane.get_contentWindow();
+ opac_browser.addEventListener('load',opac_wrapper_set_help_context,false);
+}
+
+xulG.reload_opac = function() {
+ try {
+ JSAN.use('util.widgets');
+ opac_browser.g.browser.reload();
+ } catch(E) {
+ g.error.sdump("D_ERROR", 'error reloading opac: ' + E + '\n');
+ }
}
function set_serctrl_view() {
throw(r);
}
alert("MFHD record created."); //TODO: better success message
- browser_frame.contentWindow.g.browser.controller.view.cmd_reload.doCommand();
+ xulG.reload_opac(); // browser_frame.contentWindow.g.browser.controller.view.cmd_reload.doCommand();
} catch(E) {
g.error.standard_unexpected_error_alert("Create MFHD failed", E); //TODO: better error handling
}
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'));
- browser_frame.contentWindow.g.browser.controller.view.cmd_reload.doCommand();
+ xulG.reload_opac(); // browser_frame.contentWindow.g.browser.controller.view.cmd_reload.doCommand();
}
}
}
'open-ils.permacrud', method,
[ses(), rec]
);
+ xulG.reload_opac();
}
}
};
"set_patron_tab", "volume_item_creator", "get_new_session",
"holdings_maintenance_tab", "set_tab_name", "open_chrome_window",
"url_prefix", "network_meter", "page_meter", "set_statusbar",
- "set_help_context", "get_barcode"
+ "set_help_context", "get_barcode", "reload_opac"
].forEach(function(k) { content_params[k] = xulG[k]; });
xulG.new_tab(
var w = xulG.new_tab(
url,
{ 'tab_name' : title },
- { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ] }
+ { 'doc_id' : docid, 'ou_ids' : [ ses('ws_ou') ], 'reload_opac' : xulG.reload_opac }
);
} catch(E) {
alert('Error in chrome/content/cat/opac.js, add_volumes(): ' + E);