MOBILE-3926 core: Disable tablet swipe navigation
parent
683c5f4e5a
commit
e42cab8d8b
|
@ -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>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue