@mintplayer/ng-bootstrap 13.3.2 → 13.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2992,8 +2992,9 @@ class BsNavbarItemComponent {
2992
2992
  this.anchorTag = this.element.nativeElement.querySelector('li a');
2993
2993
  if (this.hasDropdown) {
2994
2994
  (this.anchorTag) && this.anchorTag.classList.add('dropdown-toggle');
2995
- if (this.anchorTag && !this.anchorTag.onclick) {
2996
- this.anchorTag.onclick = (ev) => {
2995
+ if (this.anchorTag && !this.anchorTag.getAttribute('close-init-b')) {
2996
+ this.anchorTag.setAttribute('close-init-b', '1');
2997
+ this.anchorTag.addEventListener('click', (ev) => {
2997
2998
  ev.preventDefault();
2998
2999
  // Normally there should be only one dropdown in this list
2999
3000
  this.dropdowns.forEach((dropdown) => {
@@ -3004,24 +3005,23 @@ class BsNavbarItemComponent {
3004
3005
  }
3005
3006
  });
3006
3007
  return false;
3007
- };
3008
+ });
3008
3009
  }
3009
3010
  }
3010
3011
  else {
3011
3012
  // Close if this is a link
3012
- if (this.dropdowns.length === 0) {
3013
- if (this.anchorTag && !this.anchorTag.onclick) {
3014
- this.anchorTag.onclick = (ev) => {
3015
- let d = this.parentDropdown;
3016
- while (d && d.autoclose) {
3017
- d.isVisible = false;
3018
- d = d.parentDropdown;
3019
- }
3020
- if (this.navbar.autoclose) {
3021
- this.navbar.isExpanded$.next(false);
3022
- }
3023
- };
3024
- }
3013
+ if ((this.dropdowns.length === 0) && this.anchorTag && !this.anchorTag.getAttribute('close-init-a')) {
3014
+ this.anchorTag.setAttribute('close-init-a', '1');
3015
+ this.anchorTag.addEventListener('click', (ev) => {
3016
+ let d = this.parentDropdown;
3017
+ while (d && d.autoclose) {
3018
+ d.isVisible = false;
3019
+ d = d.parentDropdown;
3020
+ }
3021
+ if (this.navbar.autoclose) {
3022
+ this.navbar.isExpanded$.next(false);
3023
+ }
3024
+ });
3025
3025
  }
3026
3026
  }
3027
3027
  }