From 8be43be6677ea875f3d75604513b0f6a82b29c1a Mon Sep 17 00:00:00 2001 From: MaxKoll Date: Wed, 19 May 2021 18:07:38 +0200 Subject: [PATCH] Options: Associate file picker with input box by id, not order of appearance in the code. --- content/options.js | 4 ++-- content/options.xhtml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/options.js b/content/options.js index fc2d794..96d8a5b 100644 --- a/content/options.js +++ b/content/options.js @@ -17,7 +17,7 @@ window.addEventListener("load", function (event) { }, false); }, false); -function pick_file(pref, title) { +function pick_file(textboxId, title) { var nsIFilePicker = Components.interfaces.nsIFilePicker; var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); fp.init(window, "Select the "+title+" binary", nsIFilePicker.modeOpen); @@ -26,7 +26,7 @@ function pick_file(pref, title) { if( rv != nsIFilePicker.returnOK) { return; } - pref.value = fp.file.path; + document.getElementById(textboxId).value = fp.file.path; }); } diff --git a/content/options.xhtml b/content/options.xhtml index ab43acf..fc34134 100644 --- a/content/options.xhtml +++ b/content/options.xhtml @@ -15,12 +15,12 @@