electron-create-menu
Advanced tools
Comparing version 1.0.0 to 1.1.0
10
index.js
@@ -118,9 +118,11 @@ const { app, Menu } = require("electron"); | ||
const electronMenu = (callback = passThrough, i18nFunc = passThrough) => { | ||
Menu.setApplicationMenu( | ||
Menu.buildFromTemplate( | ||
filterMenu(callback(createTemplate(i18nFunc), SEPARATOR)) | ||
) | ||
const createdMenu = Menu.buildFromTemplate( | ||
filterMenu(callback(createTemplate(i18nFunc), SEPARATOR)) | ||
); | ||
Menu.setApplicationMenu(createdMenu); | ||
return createdMenu; | ||
}; | ||
module.exports = electronMenu; |
{ | ||
"name": "electron-create-menu", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "provides a default menu for your electron applications, with convenience functions for multiplatform use and i18n.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
# Electron-create-menu | ||
# Electron-create-menu [![npm](https://img.shields.io/npm/v/electron-create-menu.svg)](https://www.npmjs.com/package/electron-create-menu) [![npm-downloads](https://img.shields.io/npm/dm/electron-create-menu.svg)](https://www.npmjs.com/package/electron-create-menu) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKilian%2Felectron-create-menu.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FKilian%2Felectron-create-menu?ref=badge_shield) | ||
@@ -26,2 +26,6 @@ provides a default menu for your electron applications, with convenience functions for multiplatform use and i18n. | ||
*Note:* This API has to be called after the `ready` event of `app` module. | ||
Menu always returns the menu object that `Menu.buildFromTemplate` creates, so you can access [instance methods](https://electronjs.org/docs/api/menu#instance-methods) on it. | ||
### Optional arguments | ||
@@ -28,0 +32,0 @@ Menu has two optional functions you can pass it |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8428
138