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

[CLOSED] dropdown events not properly attached #1012

Open
core-ai-bot opened this issue Aug 29, 2021 · 5 comments
Open

[CLOSED] dropdown events not properly attached #1012

core-ai-bot opened this issue Aug 29, 2021 · 5 comments

Comments

@core-ai-bot
Copy link
Member

Issue by jrowny
Friday Jun 08, 2012 at 20:09 GMT
Originally opened as adobe/brackets#1018


In menu.js on line 626, a few events are attached to the menu but they are not done so using live. If you use "addMenu" to add a new menu, these events don't get triggered. They need to be changed to live.

Specifically the two events are "mousedown" to prevent loosing focus and "mouseenter" to automatically open a menu if another is already opened.

To reproduce the bug, use menu = addMenu("Some-Item", "Some Menu" and menu.addMenuItem("new-menu", Commands.WHATEVER); in an extension or somehwere after the menu has loaded.

I will create a pull request to change this to "live" sometime this weekend if I get time. You can assign this to me if you want.

@core-ai-bot
Copy link
Member Author

Comment by njx
Friday Jun 08, 2012 at 20:25 GMT


I think the standard way to do delegate/live in jQuery 1.7 is $(parentEl).on("eventName", "childSelector", handler). So in this case, it's probably $("#main-toolbar").on("mousedown", ".dropdown", ...)

@core-ai-bot
Copy link
Member Author

Comment by njx
Friday Jun 08, 2012 at 20:26 GMT


BTW, it looks we can't actually assign bugs to people outside the Adobe org :) If you do pick this up, just comment that you've started working on it.

Marking "medium priority" and sprint 10 since it's related to menu work we're doing in this sprint.

@core-ai-bot
Copy link
Member Author

Comment by jrowny
Friday Jun 08, 2012 at 20:28 GMT


Oh yea, I forgot on took over. Okay, I'll start working on it this weekend using "on."

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Friday Jun 08, 2012 at 20:39 GMT


Side note: besides being deprecated, live() also supposedly has serious performance problems because it listens for the event document-wide and then filters each one. (Unlike delegate(), which I think is merely deprecated).

@core-ai-bot
Copy link
Member Author

Comment by jrowny
Saturday Jun 09, 2012 at 02:38 GMT


I made the pull: adobe/brackets#1021

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

No branches or pull requests

1 participant