Skip to content

Add and document menu events - #11754

Merged
codebytere merged 8 commits into
masterfrom
menu-events
Jan 29, 2018
Merged

codebytere merged 8 commits into
masterfrom
menu-events

Conversation

@codebytere

@codebytere codebytere commented Jan 27, 2018 •

Copy link
Copy Markdown
Member

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 a team January 27, 2018 14:37
@codebytere codebytere changed the title [WIP] add and document menu events [WIP] Add and document menu events Jan 27, 2018
@codebytere
codebytere requested a review from a team January 27, 2018 16:28
@codebytere
codebytere requested a review from ckerr January 27, 2018 17:37
}

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@codebytere codebytere Jan 28, 2018 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread docs/api/menu.md Outdated

* `event` Event

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@codebytere codebytere changed the title [WIP] Add and document menu events Add and document menu events Jan 28, 2018
Comment thread spec/api-menu-spec.js
})

it('should emit menu-will-show event', (done) => {
menu.on('menu-will-show', () => { done() })

@alexeykuzmin alexeykuzmin Jan 28, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh oops i copied that incorrectly

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexeykuzmin it's fixed now

@codebytere
codebytere merged commit 12d4f98 into master Jan 29, 2018
@codebytere
codebytere deleted the menu-events branch January 29, 2018 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support menuDidClose/menuWillOpen

3 participants