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

Add and document menu events #11754

Merged
merged 8 commits into from Jan 29, 2018

Conversation

Projects
None yet
3 participants
@codebytere
Member

codebytere commented Jan 27, 2018

Closes #8999 by adding event emission for menu-will-show and menu-will-close.

To-Do:

  • document new menu events
  • add (passing) specs

/cc @MarshallOfSound

@codebytere codebytere requested a review from electron/reviewers as a code owner Jan 27, 2018

@codebytere codebytere changed the title from [WIP] add and document menu events to [WIP] Add and document menu events Jan 27, 2018

codebytere added some commits Jan 27, 2018

@codebytere codebytere requested a review from electron/docs as a code owner Jan 27, 2018

@codebytere codebytere requested a review from ckerr Jan 27, 2018

}
Menu::~Menu() {
if (model_) {

This comment has been minimized.

@alexeykuzmin

alexeykuzmin Jan 28, 2018

Contributor

Why do you need this check? Can the model_ be destroyed before the Menu destructor is called?

This comment has been minimized.

@codebytere

codebytere Jan 28, 2018

Member

yes, exactly; model_ can be destroyed before attempting to RemoveObserver(this), which would cause a crash, so the check is needed

* `event` Event
Emitted when a popup is close either manually or with `menu.closePopup()`

This comment has been minimized.

@alexeykuzmin

alexeykuzmin Jan 28, 2018

Contributor

<nitpicking>
is closed maybe?
– a full stop at the end of the sentence? )
<\nitpicking>

@codebytere codebytere changed the title from [WIP] Add and document menu events to Add and document menu events Jan 28, 2018

@@ -284,6 +284,17 @@ describe('Menu module', () => {
return closeWindow(w).then(() => { w = null })
})
it('should emit menu-will-show event', (done) => {
menu.on('menu-will-show', () => { done() })

This comment has been minimized.

@alexeykuzmin

alexeykuzmin Jan 28, 2018

Contributor

The docs say that it should work on Mac only, but the tests passed on all platforms. How is that? )

This comment has been minimized.

@codebytere

codebytere Jan 28, 2018

Member

oh oops i copied that incorrectly

This comment has been minimized.

@codebytere

@codebytere codebytere merged commit 12d4f98 into master Jan 29, 2018

8 checks passed

ci/circleci: electron-linux-arm Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm-test Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-arm64-test Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-ia32 Your tests passed on CircleCI!
Details
ci/circleci: electron-linux-x64 Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/jenkins/pr-head This commit looks good
Details

@codebytere codebytere deleted the menu-events branch Jan 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment