mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(nav, menu): swipeEnabled => swipeGesture
This commit is contained in:
@@ -100,10 +100,10 @@ export class Menu {
|
||||
/**
|
||||
* If true, swiping the menu is enabled. Default `true`.
|
||||
*/
|
||||
@Prop() swipeEnabled = true;
|
||||
@Prop() swipeGesture = true;
|
||||
|
||||
@Watch('swipeEnabled')
|
||||
protected swipeEnabledChanged() {
|
||||
@Watch('swipeGesture')
|
||||
protected swipeGestureChanged() {
|
||||
this.updateState();
|
||||
}
|
||||
/**
|
||||
@@ -304,7 +304,7 @@ export class Menu {
|
||||
}
|
||||
|
||||
private canSwipe(): boolean {
|
||||
return this.swipeEnabled && !this.isAnimating && this.isActive();
|
||||
return this.swipeGesture && !this.isAnimating && this.isActive();
|
||||
}
|
||||
|
||||
private canStart(detail: GestureDetail): boolean {
|
||||
@@ -444,7 +444,7 @@ export class Menu {
|
||||
private updateState() {
|
||||
const isActive = this.isActive();
|
||||
if (this.gesture) {
|
||||
this.gesture.setDisabled(!isActive || !this.swipeEnabled);
|
||||
this.gesture.setDisabled(!isActive || !this.swipeGesture);
|
||||
}
|
||||
|
||||
// Close menu inmediately
|
||||
|
||||
@@ -20,7 +20,7 @@ These can be controlled from the templates, or programmatically using the MenuCo
|
||||
| `maxEdgeStart` | `max-edge-start` | The edge threshold for dragging the menu open. If a drag/swipe happens over this value, the menu is not triggered. | `number` |
|
||||
| `menuId` | `menu-id` | An id for the menu. | `string` |
|
||||
| `side` | `side` | Which side of the view the menu should be placed. Default `"start"`. | `Side` |
|
||||
| `swipeEnabled` | `swipe-enabled` | If true, swiping the menu is enabled. Default `true`. | `boolean` |
|
||||
| `swipeGesture` | `swipe-gesture` | If true, swiping the menu is enabled. Default `true`. | `boolean` |
|
||||
| `type` | `type` | The display type of the menu. Available options: `"overlay"`, `"reveal"`, `"push"`. | `string` |
|
||||
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
menu.get('end').type = 'reveal';
|
||||
}
|
||||
function setEnabled() {
|
||||
menu.get('start').swipeEnabled = false;
|
||||
menu.get('start').swipeGesture = false;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
menu.get('end').type = 'reveal';
|
||||
}
|
||||
function setEnabled() {
|
||||
menu.get('start').swipeEnabled = false;
|
||||
menu.get('start').swipeGesture = false;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user