[open-ils-commits] r9041 -
branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Mar 15 02:22:13 EDT 2008
Author: phasefx
Date: 2008-03-15 01:48:30 -0400 (Sat, 15 Mar 2008)
New Revision: 9041
Modified:
branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/file.js
Log:
tweaks to file picker
Modified: branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/file.js
===================================================================
--- branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/file.js 2008-03-15 05:46:51 UTC (rev 9040)
+++ branches/rel_1_2/Open-ILS/xul/staff_client/chrome/content/util/file.js 2008-03-15 05:48:30 UTC (rev 9041)
@@ -227,6 +227,7 @@
'pick_file' : function(params) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ if (typeof params == 'undefined') params = {};
if (typeof params.mode == 'undefined') params.mode = 'open';
var nsIFilePicker = Components.interfaces.nsIFilePicker;
var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance( nsIFilePicker );
@@ -235,6 +236,9 @@
typeof params.title == 'undefined' ? params.mode : params.title,
params.mode == 'open' ? nsIFilePicker.modeOpen : nsIFilePicker.modeSave
);
+ if (params.defaultFileName) {
+ fp.defaultString = params.defaultFileName;
+ }
fp.appendFilters( nsIFilePicker.filterAll );
var fp_result = fp.show();
if ( ( fp_result == nsIFilePicker.returnOK || fp_result == nsIFilePicker.returnReplace ) && fp.file ) {
More information about the open-ils-commits
mailing list