davicotico / jQuery-Menu-Editor

Multilevel Menu Editor for Bootstrap 4.x (Html & Javascript code)
https://davidticona.com/demos/jQuery-Menu-Editor/
MIT License
191 stars 86 forks source link

Double deleting confirmation with 2 menu editors on page #20

Closed PeterTillema closed 1 year ago

PeterTillema commented 3 years ago

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.

davicotico commented 3 years ago

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

lucaslm commented 3 years ago

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:

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.

davicotico commented 3 years ago

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

davicotico commented 3 years ago

Version 1.1.1 will be released in the next few hours.

lucaslm commented 3 years ago

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

davicotico commented 1 year ago

@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.