Skip to content

Conversation

@metric152
Copy link
Contributor

When you have multiple context menus on the page and remove one of them the background div was still on the page.

When there are multiple namespaces the background is still present
after destroy has run. This will remove the background after everything
has be removed.
The background isn't removed when removing a context menu from the
namespace. This will remove the context menu once the namespace is
properly destroyed.
@rodneyrehm
Copy link
Contributor

Your fix is only partially correct. Say you have 2 menus and while the one is open, the other gets destroyed. You would then remove the backdrop of the first menu. Probably not what you intended?

@metric152
Copy link
Contributor Author

It sounds like I didn't explain it well.

This plugin is being used in a web app where there are multiple instances of context menus. The uri changes, but the screen just repaints portions of itself. At any given time only one context menu is shown on the screen.

One of the context menu items triggers a section of the page to repaint but happens too quickly for setTimer to remove the background that detects when you've clicked outside of the menu.

The current code in the destroy function removes the background, but only if there is one context menu on the page. When there are multiple the destroy method in there leaves the background element on the page.

The change I made allowed the other context menus to function properly. The background still showed when the other context menus were triggered.

@rodneyrehm
Copy link
Contributor

One of the context menu items triggers a section of the page to repaint but happens too quickly for setTimer to remove the background that detects when you've clicked outside of the menu.

I'm not sure I understand this. setTimer is what exactly?

The current code in the destroy function removes the background, but only if there is one context menu on the page. When there are multiple the destroy method in there leaves the background element on the page.

Why exactly are you destroying the menu? Are you hiding the menu before you destroy it?

@rodneyrehm
Copy link
Contributor

I've fixed the destroy function to remove the backdrop if the currently shown menu belongs to the selector to be destroyed. The fix is included in v1.5.21, available as of now.

@rodneyrehm rodneyrehm closed this Jul 14, 2012
@metric152
Copy link
Contributor Author

Thanks for the fix. I'll be able to test it out on monday.

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.

2 participants