Dropdown data-toggle="dropdown" element click events not bubble
Created by: njake
_addEventListeners function has two functions to prevent default link actions. event.preventDefault() event.stopPropagation()
If link element is not used for toggle, disabling events are not nesessary at all?
Reason is i need attach events to all toggle elements to get click events wanted from toggle elements. Better way is to attach single event listener to parent and use event.target, this is not working now.
Is it possible to add check if toggle element is link, then add those events something like:
if(this._element.nodeName == 'a'){ event.preventDefault(); event.stopPropagation(); }
or using data attribute to disable/enable bubling.