diff options
author | 2021-05-12 01:26:51 +0530 | |
---|---|---|
committer | 2021-05-11 21:56:51 +0200 | |
commit | 80d7ef19dbb4271416bd8b5bbf938e180c57e5f3 (patch) | |
tree | ec99db3b3b0727d7ac81c1ead70e17db0c1bb6b3 /src/webview/contextMenuBuilder.js | |
parent | Fixing issue with icons being garbled due to misconfiguration of gulp (diff) | |
download | ferdium-app-80d7ef19dbb4271416bd8b5bbf938e180c57e5f3.tar.gz ferdium-app-80d7ef19dbb4271416bd8b5bbf938e180c57e5f3.tar.zst ferdium-app-80d7ef19dbb4271416bd8b5bbf938e180c57e5f3.zip |
Method reuse (#1379)
* Used already exported common functions to avoid the same logic being repeated.
* Use a different package to retrieve the os-name for the 'About Dialog'.
Diffstat (limited to 'src/webview/contextMenuBuilder.js')
-rw-r--r-- | src/webview/contextMenuBuilder.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/webview/contextMenuBuilder.js b/src/webview/contextMenuBuilder.js index 7980e5344..f7d552ddd 100644 --- a/src/webview/contextMenuBuilder.js +++ b/src/webview/contextMenuBuilder.js | |||
@@ -6,6 +6,8 @@ | |||
6 | * | 6 | * |
7 | * Source: https://github.com/electron-userland/electron-spellchecker/blob/master/src/context-menu-builder.js | 7 | * Source: https://github.com/electron-userland/electron-spellchecker/blob/master/src/context-menu-builder.js |
8 | */ | 8 | */ |
9 | import { isMac } from '../environment'; | ||
10 | |||
9 | const { | 11 | const { |
10 | clipboard, nativeImage, remote, shell, | 12 | clipboard, nativeImage, remote, shell, |
11 | } = require('electron'); | 13 | } = require('electron'); |
@@ -261,7 +263,7 @@ module.exports = class ContextMenuBuilder { | |||
261 | return menu; | 263 | return menu; |
262 | } | 264 | } |
263 | 265 | ||
264 | if (process.platform === 'darwin') { | 266 | if (isMac) { |
265 | const webContents = this.getWebContents(); | 267 | const webContents = this.getWebContents(); |
266 | 268 | ||
267 | const lookUpDefinition = new MenuItem({ | 269 | const lookUpDefinition = new MenuItem({ |