aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/logger.js2
-rw-r--r--lib/prompts.js3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/logger.js b/lib/logger.js
index 2b2d228..94f7031 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -49,7 +49,7 @@ exports.clearTimeSheet = function clearTimeSheet() {
};
exports.importTimeSheet = function importTimeSheet() {
- var filename = prompts.promptFileOpenPicker(that.win);
+ var filename = prompts.promptFileOpenPicker();
if (fileMod.exists(filename)) {
var otherTS = JSON.parse(fileMod.read(filename));
if (otherTS.logs) {
diff --git a/lib/prompts.js b/lib/prompts.js
index d4a5293..ed9b3e5 100644
--- a/lib/prompts.js
+++ b/lib/prompts.js
@@ -97,9 +97,10 @@ exports.promptYesNoCancel = function promptOKNoCancel(prompt) {
* documentation is https://developer.mozilla.org/en/NsIFilePicker
*/
exports.promptFileOpenPicker = function promptFilePicker (win) {
+ var window = require("window-utils").activeWindow;
var fp = Cc["@mozilla.org/filepicker;1"]
.createInstance(Ci.nsIFilePicker);
- fp.init(win, "JSON File Open", Ci.nsIFilePicker.modeOpen);
+ fp.init(window, "JSON File Open", Ci.nsIFilePicker.modeOpen);
fp.appendFilter("JSON files", "*.json");
fp.appendFilters(Ci.nsIFilePicker.filterAll);
fp.filterIndex = 0;