Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Context Menu Popup Parameters #1957

Merged
merged 6 commits into from
Jun 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,19 @@ before_install:
sh -e /etc/init.d/xvfb start
# uncomment once integration tests are included in CI
# docker pull dternyak/eth-priv-to-addr:latest
sudo apt-get install libusb-1.0
sudo apt-get install libusb-1.0
fi

install:
- yarn --silent

before_script:
- chmod +x ./travis-scripts/test-{linux,osx}.sh

script:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
npm run prettier:diff
npm run test:coverage -- --maxWorkers=2
npm run report-coverage
npm run tslint
npm run tscheck
npm run freezer
npm run freezer:validate
fi
- ./travis-scripts/test-linux.sh
- ./travis-scripts/test-osx.sh

- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
npm run build:electron
ls -la dist/electron-builds
fi

notifications:
email:
Expand Down
18 changes: 16 additions & 2 deletions electron-app/main/contextMenu.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { MenuItemConstructorOptions, shell, BrowserWindow, Menu, clipboard } from 'electron';
import {
MenuItemConstructorOptions,
shell,
BrowserWindow,
Menu,
clipboard,
PopupOptions
} from 'electron';
import { URL } from 'url';

function popupContextMenu(
Expand Down Expand Up @@ -86,7 +93,14 @@ function popupContextMenu(
}

const ctxMenu = Menu.buildFromTemplate(ctxMenuTmpl);
ctxMenu.popup(window, props);

const popupOpts: PopupOptions = {
window,
x: props.x,
y: props.y
};

ctxMenu.popup(popupOpts);
}

export default popupContextMenu;
12 changes: 12 additions & 0 deletions travis-scripts/test-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -ev # return value 1 (error) if any command fails, and display each command before its run
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
yarn prettier:diff
yarn test:coverage -- --maxWorkers=2
yarn report-coverage
yarn tslint
yarn tscheck
yarn freezer
yarn freezer:validate
fi
7 changes: 7 additions & 0 deletions travis-scripts/test-osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -ev # return value 1 (error) if any command fails, and display each command before its run
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
yarn build:electron
ls -la dist/electron-builds
fi