aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-03-02 00:12:52 +0100
committerMatěj Cepl <mcepl@redhat.com>2011-03-02 00:12:52 +0100
commit52bcf6e79eb3085b598a9ca0d21f60879a0e3706 (patch)
tree3bcddc3dfaa9f6ad7afbd0cf31f09d6bceb8e208
parent9e6ca915c304b08e60f6dfa453475045ef438736 (diff)
downloadbugzilla-triage-52bcf6e79eb3085b598a9ca0d21f60879a0e3706.tar.gz
Yes, we can have window object in main script!
-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;