added type doc to menu related files

This commit is contained in:
lotte
2018-12-11 15:47:41 +01:00
parent c0a4fdc797
commit e13d743e32
35 changed files with 765 additions and 231 deletions

View File

@@ -2,15 +2,14 @@ import { Component, Inject, Injector, OnInit } from '@angular/core';
import { NavbarSectionComponent } from '../navbar-section/navbar-section.component';
import { MenuService } from '../../shared/menu/menu.service';
import { MenuID } from '../../shared/menu/initial-menus-state';
import { rendersSectionForMenu } from '../../shared/menu/menu.decorator';
import { Observable } from 'rxjs/internal/Observable';
import { MenuSection } from '../../shared/menu/menu.reducer';
import { slide } from '../../shared/animations/slide';
import { first } from 'rxjs/operators';
import { HostWindowService } from '../../shared/host-window.service';
import { GenericConstructor } from '../../core/shared/generic-constructor';
import { MenuSectionComponent } from '../../shared/menu/menu-section/menu-section.component';
import { rendersSectionForMenu } from '../../shared/menu/menu-section.decorator';
/**
* Represents an expandable section in the navbar
*/
@Component({
selector: 'ds-expandable-navbar-section',
templateUrl: './expandable-navbar-section.component.html',
@@ -19,6 +18,9 @@ import { MenuSectionComponent } from '../../shared/menu/menu-section/menu-sectio
})
@rendersSectionForMenu(MenuID.PUBLIC, true)
export class ExpandableNavbarSectionComponent extends NavbarSectionComponent implements OnInit {
/**
* This section resides in the Public Navbar
*/
menuID = MenuID.PUBLIC;
constructor(@Inject('sectionDataProvider') menuSection,
@@ -33,6 +35,11 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
super.ngOnInit();
}
/**
* Overrides the super function that activates this section (triggered on hover)
* Has an extra check to make sure the section can only be activated on non-mobile devices
* @param {Event} event The user event that triggered this function
*/
activateSection(event): void {
this.windowService.isXsOrSm().pipe(
first()
@@ -43,6 +50,11 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
});
}
/**
* Overrides the super function that deactivates this section (triggered on hover)
* Has an extra check to make sure the section can only be deactivated on non-mobile devices
* @param {Event} event The user event that triggered this function
*/
deactivateSection(event): void {
this.windowService.isXsOrSm().pipe(
first()
@@ -53,6 +65,11 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
});
}
/**
* Overrides the super function that toggles this section (triggered on click)
* Has an extra check to make sure the section can only be toggled on mobile devices
* @param {Event} event The user event that triggered this function
*/
toggleSection(event): void {
event.preventDefault();
this.windowService.isXsOrSm().pipe(