From: phasefx Date: Wed, 8 Aug 2007 17:10:09 +0000 (+0000) Subject: Fix so that replacing a file with the save file dialog works. Should probably move... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0d08f19e948b20bd51628af7092ff7a3c0301bdb;p=Evergreen.git Fix so that replacing a file with the save file dialog works. Should probably move this from these files into a shared library git-svn-id: svn://svn.open-ils.org/ILS/trunk@7635 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/chrome/content/main/main.js b/Open-ILS/xul/staff_client/chrome/content/main/main.js index 384b86323a..cd9916baab 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/main.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/main.js @@ -34,7 +34,8 @@ function pick_file(mode) { mode == 'open' ? nsIFilePicker.modeOpen : nsIFilePicker.modeSave ); fp.appendFilters( nsIFilePicker.filterAll ); - if ( fp.show( ) == nsIFilePicker.returnOK && fp.file ) { + var fp_result = fp.show(); + if ( ( fp_result == nsIFilePicker.returnOK || fp_result == nsIFilePicker.returnReplace ) && fp.file ) { return fp.file; } else { return null; diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js index f81fc2b58a..8963d04e4f 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -188,7 +188,8 @@ function pick_file(mode) { mode == 'open' ? nsIFilePicker.modeOpen : nsIFilePicker.modeSave ); fp.appendFilters( nsIFilePicker.filterAll ); - if ( fp.show( ) == nsIFilePicker.returnOK && fp.file ) { + var fp_result = fp.show(); + if ( ( fp_result == nsIFilePicker.returnOK || fp_result == nsIFilePicker.returnReplace ) && fp.file ) { return fp.file; } else { return null; diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js index e2d0ccabbd..9be6ee8899 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -298,7 +298,8 @@ circ.copy_status.prototype = { mode == 'open' ? nsIFilePicker.modeOpen : nsIFilePicker.modeSave ); fp.appendFilters( nsIFilePicker.filterAll ); - if ( fp.show( ) == nsIFilePicker.returnOK && fp.file ) { + var fp_result = fp.show(); + if ( ( fp_result == nsIFilePicker.returnOK || fp_result == nsIFilePicker.returnReplace ) && fp.file ) { return fp.file; } else { return null; diff --git a/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js b/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js index 3ca8ce11b9..632f6092d6 100644 --- a/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js +++ b/Open-ILS/xul/staff_client/server/circ/print_list_template_editor.js @@ -366,7 +366,8 @@ circ.print_list_template_editor.prototype = { mode == 'open' ? nsIFilePicker.modeOpen : nsIFilePicker.modeSave ); fp.appendFilters( nsIFilePicker.filterAll ); - if ( fp.show( ) == nsIFilePicker.returnOK && fp.file ) { + var fp_result = fp.show(); + if ( ( fp_result == nsIFilePicker.returnOK || fp_result == nsIFilePicker.returnReplace ) && fp.file ) { return fp.file; } else { return null;