diff --git a/xpfe/components/filepicker/res/content/filepicker.js b/xpfe/components/filepicker/res/content/filepicker.js index ad7f8207132..e582fed6a19 100644 --- a/xpfe/components/filepicker/res/content/filepicker.js +++ b/xpfe/components/filepicker/res/content/filepicker.js @@ -300,10 +300,10 @@ function selectOnOK() retvals.file = file; retvals.buttonStatus = ret; - if (ret == nsIFilePicker.returnCancel) - return false; - else - return true; + var filterMenuList = document.getElementById("filterMenuList"); + retvals.filterIndex = filterMenuList.selectedIndex; + + return (ret != nsIFilePicker.returnCancel); } function onCancel() diff --git a/xpfe/components/filepicker/src/nsFilePicker.js b/xpfe/components/filepicker/src/nsFilePicker.js index 84a5eaca08e..eab696dd5cf 100644 --- a/xpfe/components/filepicker/src/nsFilePicker.js +++ b/xpfe/components/filepicker/src/nsFilePicker.js @@ -102,7 +102,7 @@ nsFilePicker.prototype = { /* attribute long filterIndex; */ set filterIndex(a) { this.mFilterIndex = a; }, - get filterInrex() { return this.mFilterIndex; }, + get filterIndex() { return this.mFilterIndex; }, /* methods */ init: function(parent, title, mode) { @@ -185,7 +185,7 @@ nsFilePicker.prototype = { "chrome,modal,titlebar,resizable=yes,dependent=yes", o); this.mFile = o.retvals.file; - this.mFilterIndex = o.retvals.filterindex; + this.mFilterIndex = o.retvals.filterIndex; lastDirectory = o.retvals.directory; return o.retvals.buttonStatus; } catch(ex) { dump("unable to open file picker\n" + ex + "\n"); } diff --git a/xpfe/components/filepicker/src/nsFilePicker.js.in b/xpfe/components/filepicker/src/nsFilePicker.js.in index 84a5eaca08e..eab696dd5cf 100644 --- a/xpfe/components/filepicker/src/nsFilePicker.js.in +++ b/xpfe/components/filepicker/src/nsFilePicker.js.in @@ -102,7 +102,7 @@ nsFilePicker.prototype = { /* attribute long filterIndex; */ set filterIndex(a) { this.mFilterIndex = a; }, - get filterInrex() { return this.mFilterIndex; }, + get filterIndex() { return this.mFilterIndex; }, /* methods */ init: function(parent, title, mode) { @@ -185,7 +185,7 @@ nsFilePicker.prototype = { "chrome,modal,titlebar,resizable=yes,dependent=yes", o); this.mFile = o.retvals.file; - this.mFilterIndex = o.retvals.filterindex; + this.mFilterIndex = o.retvals.filterIndex; lastDirectory = o.retvals.directory; return o.retvals.buttonStatus; } catch(ex) { dump("unable to open file picker\n" + ex + "\n"); }