Fix MenuButton for the case where multiple listeners are defined.
This is a minimal fix suitable for merging to M38. The underlying problem
is that we create a new MenuButton instance (with its own click handler)
for every connection. I recently changed the behaviour of MenuButton so
that it toggles the 'active' class instead of adding it so that clicking
on the button while a menu is open will dismiss it. However, this breaks
if there an even number of MenuButton instances for a single DOM element.
The correct fix is to make the tool-bar buttons owned by the tool-bar,
which is a singleton. However, this minimal fix, which restores the M37
behaviour, is a better option for merging to M38.
BUG=415410
Review URL: https://codereview.chromium.org/584693003
Cr-Commit-Position: refs/heads/master@{#295759}
2 files changed