mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 04:53:58 +08:00
chore(menu): rename swipe progress steps
This commit is contained in:
@ -70,7 +70,7 @@ export class MenuContentGesture extends SlideEdgeGesture {
|
|||||||
// Set CSS, then wait one frame for it to apply before sliding starts
|
// Set CSS, then wait one frame for it to apply before sliding starts
|
||||||
onSlideBeforeStart(slide, ev) {
|
onSlideBeforeStart(slide, ev) {
|
||||||
console.debug('menu gesture, onSlideBeforeStart', this.menu.side);
|
console.debug('menu gesture, onSlideBeforeStart', this.menu.side);
|
||||||
this.menu.setProgressStart();
|
this.menu.swipeStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
onSlide(slide, ev) {
|
onSlide(slide, ev) {
|
||||||
@ -78,7 +78,7 @@ export class MenuContentGesture extends SlideEdgeGesture {
|
|||||||
let stepValue = (slide.distance / z);
|
let stepValue = (slide.distance / z);
|
||||||
console.debug('menu gesture, onSlide', this.menu.side, 'distance', slide.distance, 'min', slide.min, 'max', slide.max, 'z', z, 'stepValue', stepValue);
|
console.debug('menu gesture, onSlide', this.menu.side, 'distance', slide.distance, 'min', slide.min, 'max', slide.max, 'z', z, 'stepValue', stepValue);
|
||||||
|
|
||||||
this.menu.setProgessStep(stepValue);
|
this.menu.swipeProgress(stepValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
onSlideEnd(slide, ev) {
|
onSlideEnd(slide, ev) {
|
||||||
@ -91,7 +91,7 @@ export class MenuContentGesture extends SlideEdgeGesture {
|
|||||||
|
|
||||||
console.debug('menu gesture, onSlide', this.menu.side, 'distance', slide.distance, 'delta', slide.delta, 'velocityX', ev.velocityX, 'min', slide.min, 'max', slide.max, 'shouldComplete', shouldComplete, 'currentStepValue', currentStepValue);
|
console.debug('menu gesture, onSlide', this.menu.side, 'distance', slide.distance, 'delta', slide.delta, 'velocityX', ev.velocityX, 'min', slide.min, 'max', slide.max, 'shouldComplete', shouldComplete, 'currentStepValue', currentStepValue);
|
||||||
|
|
||||||
this.menu.setProgressEnd(shouldComplete, currentStepValue);
|
this.menu.swipeEnd(shouldComplete, currentStepValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
getElementStartPos(slide, ev) {
|
getElementStartPos(slide, ev) {
|
||||||
|
@ -256,7 +256,7 @@ export class Menu extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
setProgressStart() {
|
swipeStart() {
|
||||||
// user started swiping the menu open/close
|
// user started swiping the menu open/close
|
||||||
if (this._isPrevented() || !this._isEnabled || !this._isSwipeEnabled) return;
|
if (this._isPrevented() || !this._isEnabled || !this._isSwipeEnabled) return;
|
||||||
|
|
||||||
@ -267,7 +267,7 @@ export class Menu extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
setProgessStep(stepValue: number) {
|
swipeProgress(stepValue: number) {
|
||||||
// user actively dragging the menu
|
// user actively dragging the menu
|
||||||
if (this._isEnabled && this._isSwipeEnabled) {
|
if (this._isEnabled && this._isSwipeEnabled) {
|
||||||
this._prevent();
|
this._prevent();
|
||||||
@ -279,12 +279,12 @@ export class Menu extends Ion {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
setProgressEnd(shouldComplete: boolean, currentStepValue: number) {
|
swipeEnd(shouldComplete: boolean, currentStepValue: number) {
|
||||||
// user has finished dragging the menu
|
// user has finished dragging the menu
|
||||||
if (this._isEnabled && this._isSwipeEnabled) {
|
if (this._isEnabled && this._isSwipeEnabled) {
|
||||||
this._prevent();
|
this._prevent();
|
||||||
this._getType().setProgressEnd(shouldComplete, currentStepValue, (isOpen) => {
|
this._getType().setProgressEnd(shouldComplete, currentStepValue, (isOpen) => {
|
||||||
console.debug('menu, progress end', this.side);
|
console.debug('menu, swipeEnd', this.side);
|
||||||
this._after(isOpen);
|
this._after(isOpen);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user