mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Attempt to stop scroll to bottom of page when clicking spacebar
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<div class="nav-item dropdown expandable-navbar-section"
|
<div class="nav-item dropdown expandable-navbar-section"
|
||||||
*ngVar="(active | async) as isActive"
|
*ngVar="(active | async) as isActive"
|
||||||
(keyup.enter)="isActive ? deactivateSection($event) : activateSection($event)"
|
(keyup.enter)="isActive ? deactivateSection($event) : activateSection($event)"
|
||||||
(keyup.space)="isActive ? deactivateSection($event) : activateSection($event)"
|
(keyup.space)="$event.stopPropagation(); isActive ? deactivateSection($event) : activateSection($event)"
|
||||||
(mouseenter)="activateSection($event)"
|
(mouseenter)="activateSection($event)"
|
||||||
(mouseleave)="deactivateSection($event)">
|
(mouseleave)="deactivateSection($event)">
|
||||||
<a href="#" class="nav-link dropdown-toggle" routerLinkActive="active"
|
<a href="#" class="nav-link dropdown-toggle" routerLinkActive="active"
|
||||||
|
@@ -42,6 +42,7 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
|
|||||||
* @param {Event} event The user event that triggered this function
|
* @param {Event} event The user event that triggered this function
|
||||||
*/
|
*/
|
||||||
activateSection(event): void {
|
activateSection(event): void {
|
||||||
|
event.preventDefault();
|
||||||
this.windowService.isXsOrSm().pipe(
|
this.windowService.isXsOrSm().pipe(
|
||||||
first()
|
first()
|
||||||
).subscribe((isMobile) => {
|
).subscribe((isMobile) => {
|
||||||
@@ -57,6 +58,7 @@ export class ExpandableNavbarSectionComponent extends NavbarSectionComponent imp
|
|||||||
* @param {Event} event The user event that triggered this function
|
* @param {Event} event The user event that triggered this function
|
||||||
*/
|
*/
|
||||||
deactivateSection(event): void {
|
deactivateSection(event): void {
|
||||||
|
event.preventDefault();
|
||||||
this.windowService.isXsOrSm().pipe(
|
this.windowService.isXsOrSm().pipe(
|
||||||
first()
|
first()
|
||||||
).subscribe((isMobile) => {
|
).subscribe((isMobile) => {
|
||||||
|
Reference in New Issue
Block a user