[open-ils-commits] r9040 -
trunk/Open-ILS/xul/staff_client/chrome/content/util
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Mar 15 02:20:34 EDT 2008
Author: phasefx
Date: 2008-03-15 01:46:51 -0400 (Sat, 15 Mar 2008)
New Revision: 9040
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/util/file.js
Log:
tweaks to file picker
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/file.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/file.js 2008-03-15 05:46:21 UTC (rev 9039)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/file.js 2008-03-15 05:46:51 UTC (rev 9040)
@@ -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