mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
refactor(overlay): remove default pageTransitionDelay on dismiss
This commit is contained in:
@ -58,7 +58,7 @@ export class ActionSheetCmp {
|
||||
|
||||
constructor(
|
||||
private _viewCtrl: ViewController,
|
||||
private _config: Config,
|
||||
config: Config,
|
||||
private _elementRef: ElementRef,
|
||||
gestureCtrl: GestureController,
|
||||
params: NavParams,
|
||||
@ -66,7 +66,7 @@ export class ActionSheetCmp {
|
||||
) {
|
||||
this.gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
|
||||
this.d = params.data;
|
||||
this.mode = _config.get('mode');
|
||||
this.mode = config.get('mode');
|
||||
renderer.setElementClass(_elementRef.nativeElement, `action-sheet-${this.mode}`, true);
|
||||
|
||||
if (this.d.cssClass) {
|
||||
@ -141,7 +141,7 @@ export class ActionSheetCmp {
|
||||
}
|
||||
}
|
||||
|
||||
click(button: any, dismissDelay?: number) {
|
||||
click(button: any) {
|
||||
if (! this.enabled ) {
|
||||
return;
|
||||
}
|
||||
@ -157,16 +157,14 @@ export class ActionSheetCmp {
|
||||
}
|
||||
|
||||
if (shouldDismiss) {
|
||||
setTimeout(() => {
|
||||
this.dismiss(button.role);
|
||||
}, dismissDelay || this._config.get('pageTransitionDelay'));
|
||||
this.dismiss(button.role);
|
||||
}
|
||||
}
|
||||
|
||||
bdClick() {
|
||||
if (this.enabled && this.d.enableBackdropDismiss) {
|
||||
if (this.d.cancelButton) {
|
||||
this.click(this.d.cancelButton, 1);
|
||||
this.click(this.d.cancelButton);
|
||||
|
||||
} else {
|
||||
this.dismiss('backdrop');
|
||||
|
@ -94,7 +94,7 @@ export class AlertCmp {
|
||||
constructor(
|
||||
public _viewCtrl: ViewController,
|
||||
public _elementRef: ElementRef,
|
||||
public _config: Config,
|
||||
config: Config,
|
||||
gestureCtrl: GestureController,
|
||||
params: NavParams,
|
||||
private _renderer: Renderer,
|
||||
@ -103,7 +103,7 @@ export class AlertCmp {
|
||||
// gesture blocker is used to disable gestures dynamically
|
||||
this.gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
|
||||
this.d = params.data;
|
||||
this.mode = _config.get('mode');
|
||||
this.mode = config.get('mode');
|
||||
_renderer.setElementClass(_elementRef.nativeElement, `alert-${this.mode}`, true);
|
||||
|
||||
if (this.d.cssClass) {
|
||||
@ -233,7 +233,7 @@ export class AlertCmp {
|
||||
}
|
||||
}
|
||||
|
||||
btnClick(button: any, dismissDelay?: number) {
|
||||
btnClick(button: any) {
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
}
|
||||
@ -253,10 +253,7 @@ export class AlertCmp {
|
||||
}
|
||||
|
||||
if (shouldDismiss) {
|
||||
setTimeout(() => {
|
||||
this.dismiss(button.role);
|
||||
}, dismissDelay || this._config.get('pageTransitionDelay'));
|
||||
|
||||
this.dismiss(button.role);
|
||||
focusOutActiveElement();
|
||||
}
|
||||
}
|
||||
@ -288,7 +285,7 @@ export class AlertCmp {
|
||||
if (this.enabled && this.d.enableBackdropDismiss) {
|
||||
let cancelBtn = this.d.buttons.find(b => b.role === 'cancel');
|
||||
if (cancelBtn) {
|
||||
this.btnClick(cancelBtn, 1);
|
||||
this.btnClick(cancelBtn);
|
||||
|
||||
} else {
|
||||
this.dismiss('backdrop');
|
||||
|
@ -461,14 +461,14 @@ export class PickerCmp {
|
||||
constructor(
|
||||
private _viewCtrl: ViewController,
|
||||
private _elementRef: ElementRef,
|
||||
private _config: Config,
|
||||
config: Config,
|
||||
gestureCtrl: GestureController,
|
||||
params: NavParams,
|
||||
renderer: Renderer
|
||||
) {
|
||||
this._gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
|
||||
this.d = params.data;
|
||||
this.mode = _config.get('mode');
|
||||
this.mode = config.get('mode');
|
||||
renderer.setElementClass(_elementRef.nativeElement, `picker-${this.mode}`, true);
|
||||
|
||||
if (this.d.cssClass) {
|
||||
@ -579,7 +579,7 @@ export class PickerCmp {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
btnClick(button: any, dismissDelay?: number) {
|
||||
btnClick(button: any) {
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
}
|
||||
@ -599,9 +599,7 @@ export class PickerCmp {
|
||||
}
|
||||
|
||||
if (shouldDismiss) {
|
||||
setTimeout(() => {
|
||||
this.dismiss(button.role);
|
||||
}, dismissDelay || this._config.get('pageTransitionDelay'));
|
||||
this.dismiss(button.role);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,15 +108,14 @@ import { isObject, isDefined, isFunction, isArray } from '../util/util';
|
||||
* | `menuType` | `string` | Type of menu to display. Available options: `"overlay"`, `"reveal"`, `"push"`. |
|
||||
* | `modalEnter` | `string` | The name of the transition to use while a modal is presented. |
|
||||
* | `modalLeave` | `string` | The name of the transition to use while a modal is dismiss. |
|
||||
* | `mode` | `string` | The mode to use throughout the application. |
|
||||
* | `mode` | `string` | The mode to use throughout the application. |
|
||||
* | `pageTransition` | `string` | The name of the transition to use while changing pages. |
|
||||
* | `pageTransitionDelay` | `number` | The delay in milliseconds before the transition starts while changing pages. |
|
||||
* | `pickerEnter` | `string` | The name of the transition to use while a picker is presented. |
|
||||
* | `pickerLeave` | `string` | The name of the transition to use while a picker is dismissed. |
|
||||
* | `popoverEnter` | `string` | The name of the transition to use while a popover is presented. |
|
||||
* | `popoverLeave` | `string` | The name of the transition to use while a popover is dismissed. |
|
||||
* | `spinner` | `string` | The default spinner to use when a name is not defined. |
|
||||
* | `swipeBackEnabled` | `boolean` | Whether native iOS swipe to go back functionality is enabled.
|
||||
* | `swipeBackEnabled` | `boolean` | Whether native iOS swipe to go back functionality is enabled. |
|
||||
* | `tabsHighlight` | `boolean` | Whether to show a highlight line under the tab when it is selected. |
|
||||
* | `tabsLayout` | `string` | The layout to use for all tabs. Available options: `"icon-top"`, `"icon-left"`, `"icon-right"`, `"icon-bottom"`, `"icon-hide"`, `"title-hide"`. |
|
||||
* | `tabsPlacement` | `string` | The position of the tabs relative to the content. Available options: `"top"`, `"bottom"` |
|
||||
|
@ -24,7 +24,6 @@ export const MODE_IOS: any = {
|
||||
modalLeave: 'modal-slide-out',
|
||||
|
||||
pageTransition: 'ios-transition',
|
||||
pageTransitionDelay: 16,
|
||||
|
||||
pickerEnter: 'picker-slide-in',
|
||||
pickerLeave: 'picker-slide-out',
|
||||
@ -68,7 +67,6 @@ export const MODE_MD: any = {
|
||||
modalLeave: 'modal-md-slide-out',
|
||||
|
||||
pageTransition: 'md-transition',
|
||||
pageTransitionDelay: 64,
|
||||
|
||||
pickerEnter: 'picker-slide-in',
|
||||
pickerLeave: 'picker-slide-out',
|
||||
@ -112,7 +110,6 @@ export const MODE_WP: any = {
|
||||
modalLeave: 'modal-md-slide-out',
|
||||
|
||||
pageTransition: 'wp-transition',
|
||||
pageTransitionDelay: 96,
|
||||
|
||||
pickerEnter: 'picker-slide-in',
|
||||
pickerLeave: 'picker-slide-out',
|
||||
|
Reference in New Issue
Block a user