function $(id) { return document.getElementById(id); }
function oils_lock_page(params) {
+ dump('oils_lock_page\n');
if (!params) { params = {}; }
if (window.oils_lock) {
if (!params.allow_multiple_locks) {
}
function oils_unlock_page(params) {
+ dump('oils_unlock_page\n');
window.oils_lock = false;
if (typeof xulG != 'undefined') {
if (typeof xulG.unlock_tab == 'function') {
window.addEventListener(
'close',
function(ev) {
-
+ try {
+ dump('oils_lock_page/oils_unlock_page onclose handler\n');
if (window.oils_lock) {
var confirmation = window.confirm($('offlineStrings').getString('menu.close_window.unsaved_data_warning'));
if (!confirmation) {
}
}
+ // Dispatching the window close event doesn't always close the window, even though the event does happen
+ setTimeout(
+ function() {
+ try {
+ window.close();
+ } catch(E) {
+ dump('Error inside global_util.js, onclose handler, setTimeout window.close KLUDGE: ' + E + '\n');
+ }
+ }, 0
+ );
+
return true;
+ } catch(E) {
+ dump('Error inside global_util.js, onclose handler: ' + E + '\n');
+ return true;
+ }
},
false
);
g.summarize( g.copies );
g.render();
g.check_for_unmet_required_fields();
+ oils_unlock_page();
}
/******************************************************************************************************/
alert(E);
}
}
+
+ oils_lock_page();
}
/******************************************************************************************************/
g.error.standard_unexpected_error_alert('apply_stat_cat',E);
}
}
+
+ oils_lock_page();
}
/******************************************************************************************************/
g.error.standard_unexpected_error_alert('apply_stat_cat',E);
}
}
+
+ oils_lock_page();
}
/******************************************************************************************************/
g.stash_and_close = function() {
try {
+ oils_unlock_page();
+
if (g.handle_update) {
try {
var r = g.network.request(
//g.data.stash('temp_copies');
xulG.copies = g.copies;
update_modal_xulG(xulG);
- window.close();
+ JSAN.use('util.widgets');
+ util.widgets.dispatch('close',window);
} catch(E) {
- g.error.standard_unexpected_error_alert('stash and close',E);
+ alert('Error in copy_editor.js, g.stash_and_close(): '+E);
}
}
<spacer flex="1"/>
<button id="copy_notes" label="&staff.cat.copy_editor.copy_notes.label;" accesskey="&staff.cat.copy_editor.copy_notes.accesskey;" oncommand="g.copy_notes();"/>
<button id="save" label="&staff.cat.copy_editor.save.label;" hidden="true" accesskey="&staff.cat.copy_editor.save.accesskey;" oncommand="g.stash_and_close();"/>
- <button id="cancel" label="&staff.cat.copy_editor.cancel.label;" accesskey="&staff.cat.copy_editor.cancel.accesskey;" oncommand="window.close();"/>
+ <button id="cancel" label="&staff.cat.copy_editor.cancel.label;" accesskey="&staff.cat.copy_editor.cancel.accesskey;" oncommand="JSAN.use('util.widgets'); util.widgets.dispatch('close',window);"/>
</hbox>
<spacer/>