algoliasearch-magento icon indicating copy to clipboard operation
algoliasearch-magento copied to clipboard

Double deleting confirmation with 2 menu editors on page

Open PeterTillema opened this issue 4 years ago • 5 comments

When you have a page with 2 menu editors, using the same buttons and whatever, an event is attached twice to the same element (line 1117), which causes a popup message to appear twice.

Solution: remove the click event listener before setting it.

PeterTillema avatar Dec 15 '20 14:12 PeterTillema

Hi @PeterTillema, thanks for reporting that issue. I'll check it out and fix it.

davicotico avatar Dec 15 '20 15:12 davicotico

Hello guys.

Wouldn't it be better to limit the event attachment to just the buttons pertaining to the editor being created? No need to dettach and reattach the same event this way.

I figured two ways to do it, and created the following branches for each:

  • https://github.com/davicotico/jQuery-Menu-Editor/pull/23
  • https://github.com/davicotico/jQuery-Menu-Editor/pull/24

In think I prefer the first one because the event is attached to the $main element and not the whole document, but I'm guessing the click event is attached to the document for some reason I didn't get.

lucaslm avatar Apr 23 '21 20:04 lucaslm

Hi @lucaslm I appreciate your contribution. Yes, the first one #23 is the best way. I am going to merge it. Thanks.

davicotico avatar Apr 25 '21 06:04 davicotico

Version 1.1.1 will be released in the next few hours.

davicotico avatar Apr 25 '21 06:04 davicotico

You might want to check the other stuff I've been working on my forking of this project before releasing it.

lucaslm avatar Apr 25 '21 19:04 lucaslm

@lucaslm, I really appreciate your contribution to this project. I've reviewed your other pull requests, however some of them are major changes (require a major version), so there are no plans to include them in this 1.x version. On the other hand, those pull requests that are for improvements (no structural changes), could be included progressively.

davicotico avatar Feb 18 '23 17:02 davicotico