Skip to content

Commit

Permalink
Use remote.getCurrentWindow() instead of sabaki.window
Browse files Browse the repository at this point in the history
  • Loading branch information
yishn committed May 22, 2017
1 parent 558d95d commit 0db34bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const helper = require('./helper')
exports.showMessageBox = function(message, type = 'info', buttons = ['OK'], cancelId = 0) {
sabaki.setBusy(true)

let result = dialog.showMessageBox(sabaki.window, {
let result = dialog.showMessageBox(remote.getCurrentWindow(), {
type,
buttons,
title: sabaki.appName,
Expand All @@ -24,7 +24,7 @@ exports.showFileDialog = function(type, options, callback = helper.noop) {
let [t, ...ype] = [...type]
type = t.toUpperCase() + ype.join('').toLowerCase()

let result = dialog[`show${type}Dialog`](sabaki.window, options)
let result = dialog[`show${type}Dialog`](remote.getCurrentWindow(), options)

sabaki.setBusy(false)
callback({result})
Expand Down
2 changes: 1 addition & 1 deletion modules/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ exports.popupMenu = function(template, x, y) {
let setting = remote.require('./modules/setting')
let zoomFactor = +setting.get('app.zoom_factor')

remote.Menu.buildFromTemplate(template).popup(sabaki.window, {
remote.Menu.buildFromTemplate(template).popup(remote.getCurrentWindow(), {
x: Math.round(x * zoomFactor),
y: Math.round(y * zoomFactor),
async: true
Expand Down

0 comments on commit 0db34bf

Please sign in to comment.