feat: add support for share menu on macOS (#25629)

This commit is contained in:
Cheng Zhao 2020-10-20 10:33:06 +09:00 committed by GitHub
parent 89c04b3c6c
commit 6b6ffbdd10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 316 additions and 6 deletions

View file

@ -41,6 +41,12 @@ Menu.prototype._shouldRegisterAcceleratorForCommandId = function (id) {
return this.commandsMap[id] ? this.commandsMap[id].registerAccelerator : false;
};
if (process.platform === 'darwin') {
Menu.prototype._getSharingItemForCommandId = function (id) {
return this.commandsMap[id] ? this.commandsMap[id].sharingItem : null;
};
}
Menu.prototype._executeCommand = function (event, id) {
const command = this.commandsMap[id];
if (!command) return;