mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
perf(menu): improves menu performance and fixes some edge cases
This commit is contained in:
@@ -47,6 +47,11 @@ export class MenuContentGesture extends SlideEdgeGesture {
|
||||
// Set CSS, then wait one frame for it to apply before sliding starts
|
||||
onSlideBeforeStart(ev: any) {
|
||||
console.debug('menu gesture, onSlideBeforeStart', this.menu.side);
|
||||
this.menu.swipeBeforeStart();
|
||||
}
|
||||
|
||||
onSlideStart() {
|
||||
console.debug('menu gesture, onSlideStart', this.menu.side);
|
||||
this.menu.swipeStart();
|
||||
}
|
||||
|
||||
|
||||
@@ -438,12 +438,24 @@ export class Menu {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
swipeStart() {
|
||||
// user started swiping the menu open/close
|
||||
if (this.canSwipe()) {
|
||||
this._before();
|
||||
this._getType().setProgressStart(this.isOpen);
|
||||
swipeBeforeStart() {
|
||||
if (!this.canSwipe()) {
|
||||
assert(false, 'canSwipe() has to be true');
|
||||
return;
|
||||
}
|
||||
this._before();
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
swipeStart() {
|
||||
// user actively dragging the menu
|
||||
if (!this._isAnimating) {
|
||||
assert(false, '_isAnimating has to be true');
|
||||
return;
|
||||
}
|
||||
this._getType().setProgressStart(this.isOpen);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -452,6 +464,7 @@ export class Menu {
|
||||
swipeProgress(stepValue: number) {
|
||||
// user actively dragging the menu
|
||||
if (!this._isAnimating) {
|
||||
assert(false, '_isAnimating has to be true');
|
||||
return;
|
||||
}
|
||||
this._getType().setProgessStep(stepValue);
|
||||
|
||||
@@ -80,11 +80,12 @@ $navbar-ios-height: $toolbar-ios-height !default;
|
||||
}
|
||||
|
||||
.toolbar-title-ios {
|
||||
margin-top: 1px;
|
||||
|
||||
font-size: $toolbar-ios-title-font-size;
|
||||
font-weight: $toolbar-ios-title-font-weight;
|
||||
text-align: $toolbar-ios-title-text-align;
|
||||
color: $toolbar-ios-title-text-color;
|
||||
margin-top: 1px;
|
||||
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user