mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
do not disable transitions when app disabled
This commit is contained in:
@ -129,13 +129,14 @@ export class Menu extends Ion {
|
|||||||
setProgess(value) {
|
setProgess(value) {
|
||||||
// user actively dragging the menu
|
// user actively dragging the menu
|
||||||
this._disable();
|
this._disable();
|
||||||
this.app.setEnabled(false);
|
this.app.setEnabled(false, 4000);
|
||||||
this._type.setProgess(value);
|
this._type.setProgess(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
setProgressFinish(shouldComplete) {
|
setProgressFinish(shouldComplete) {
|
||||||
// user has finished dragging the menu
|
// user has finished dragging the menu
|
||||||
this._disable();
|
this._disable();
|
||||||
|
this.app.setEnabled(false);
|
||||||
this._type.setProgressFinish(shouldComplete).then(isOpen => {
|
this._type.setProgressFinish(shouldComplete).then(isOpen => {
|
||||||
this._after(isOpen);
|
this._after(isOpen);
|
||||||
});
|
});
|
||||||
@ -148,10 +149,16 @@ export class Menu extends Ion {
|
|||||||
this.getBackdropElement().classList.add('show-backdrop');
|
this.getBackdropElement().classList.add('show-backdrop');
|
||||||
|
|
||||||
this._disable();
|
this._disable();
|
||||||
|
this.app.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
_after(isOpen) {
|
_after(isOpen) {
|
||||||
|
// keep opening/closing the menu disabled for a touch more yet
|
||||||
this._disable();
|
this._disable();
|
||||||
|
|
||||||
|
// but the app itself can be used again
|
||||||
|
this.app.setEnabled(true);
|
||||||
|
|
||||||
this.isOpen = isOpen;
|
this.isOpen = isOpen;
|
||||||
|
|
||||||
this.contentElement.classList[isOpen ? 'add' : 'remove']('menu-content-open');
|
this.contentElement.classList[isOpen ? 'add' : 'remove']('menu-content-open');
|
||||||
|
@ -61,7 +61,7 @@ export class ViewController extends Ion {
|
|||||||
* @returns {Promise} TODO
|
* @returns {Promise} TODO
|
||||||
*/
|
*/
|
||||||
push(componentType, params = {}, opts = {}) {
|
push(componentType, params = {}, opts = {}) {
|
||||||
if (!componentType || !this.app.isEnabled()) {
|
if (!componentType) {
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
if (typeof componentType !== 'function') {
|
if (typeof componentType !== 'function') {
|
||||||
@ -112,7 +112,7 @@ export class ViewController extends Ion {
|
|||||||
* @returns {Promise} TODO
|
* @returns {Promise} TODO
|
||||||
*/
|
*/
|
||||||
pop(opts = {}) {
|
pop(opts = {}) {
|
||||||
if (!this.app.isEnabled() || !this.canGoBack()) {
|
if (!this.canGoBack()) {
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user