Open XiaoMouR opened 9 years ago
I put e.stopPropagation()
in onItem
. It stops onItem
being called multiple times. Not sure whether it breaks anything.
ive been playing around with this and cannot get it to termininate gracefully. if I just use the closemenu command it throws an error saying "e" is not valid.
The reason it is happening on sub items is that its propogating up the menu tree and fires for all the parent li tags.
would be good if there was a way to tag an item as a parent as usually you dont want anything to happen when you click this item, its sole purpose is to display the submenu where all the active items are.
I create a menu which has a submenu with two items.When I trigger one of items in submenus,the onItem in the option of contextmenu will be called twice. Follow is my code.
By the way,if I add "this.closemenu()" to the end of onItem,it will stop the second time calls.