refactor(nav, menu): swipeEnabled => swipeGesture

This commit is contained in:
Manu Mtz.-Almeida
2018-08-13 18:19:19 +02:00
parent bd5a4a0294
commit 5b6eb2c7eb
11 changed files with 49 additions and 49 deletions

View File

@@ -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

View File

@@ -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` |

View File

@@ -124,7 +124,7 @@
menu.get('end').type = 'reveal';
}
function setEnabled() {
menu.get('start').swipeEnabled = false;
menu.get('start').swipeGesture = false;
}
</script>
</body>

View File

@@ -124,7 +124,7 @@
menu.get('end').type = 'reveal';
}
function setEnabled() {
menu.get('start').swipeEnabled = false;
menu.get('start').swipeGesture = false;
}
</script>
</body>