MOBILE-3926 core: Disable tablet swipe navigation

main
Noel De Martin 2021-11-17 12:29:45 +01:00
parent 683c5f4e5a
commit e42cab8d8b
2 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,4 @@
<ion-slides [options]="{ allowTouchMove: !!manager }" (swipeleft)="swipeLeft()" (swiperight)="swipeRight()">
<ion-slides [options]="{ allowTouchMove: enabled }" (swipeleft)="swipeLeft()" (swiperight)="swipeRight()">
<ion-slide>
<ng-content></ng-content>
</ion-slide>

View File

@ -14,6 +14,7 @@
import { Component, Input } from '@angular/core';
import { CoreSwipeItemsManager } from '@classes/items-management/swipe-items-manager';
import { CoreScreen } from '@services/screen';
@Component({
selector: 'core-swipe-navigation',
@ -24,10 +25,18 @@ export class CoreSwipeNavigationComponent {
@Input() manager?: CoreSwipeItemsManager;
get enabled(): boolean {
return CoreScreen.isMobile && !!this.manager;
}
/**
* Swipe to previous item.
*/
swipeLeft(): void {
if (!this.enabled) {
return;
}
this.manager?.navigateToPreviousItem();
}
@ -35,6 +44,10 @@ export class CoreSwipeNavigationComponent {
* Swipe to next item.
*/
swipeRight(): void {
if (!this.enabled) {
return;
}
this.manager?.navigateToNextItem();
}