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(
|
constructor(
|
||||||
private _viewCtrl: ViewController,
|
private _viewCtrl: ViewController,
|
||||||
private _config: Config,
|
config: Config,
|
||||||
private _elementRef: ElementRef,
|
private _elementRef: ElementRef,
|
||||||
gestureCtrl: GestureController,
|
gestureCtrl: GestureController,
|
||||||
params: NavParams,
|
params: NavParams,
|
||||||
@ -66,7 +66,7 @@ export class ActionSheetCmp {
|
|||||||
) {
|
) {
|
||||||
this.gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
|
this.gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
|
||||||
this.d = params.data;
|
this.d = params.data;
|
||||||
this.mode = _config.get('mode');
|
this.mode = config.get('mode');
|
||||||
renderer.setElementClass(_elementRef.nativeElement, `action-sheet-${this.mode}`, true);
|
renderer.setElementClass(_elementRef.nativeElement, `action-sheet-${this.mode}`, true);
|
||||||
|
|
||||||
if (this.d.cssClass) {
|
if (this.d.cssClass) {
|
||||||
@ -141,7 +141,7 @@ export class ActionSheetCmp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
click(button: any, dismissDelay?: number) {
|
click(button: any) {
|
||||||
if (! this.enabled ) {
|
if (! this.enabled ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -157,16 +157,14 @@ export class ActionSheetCmp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shouldDismiss) {
|
if (shouldDismiss) {
|
||||||
setTimeout(() => {
|
this.dismiss(button.role);
|
||||||
this.dismiss(button.role);
|
|
||||||
}, dismissDelay || this._config.get('pageTransitionDelay'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bdClick() {
|
bdClick() {
|
||||||
if (this.enabled && this.d.enableBackdropDismiss) {
|
if (this.enabled && this.d.enableBackdropDismiss) {
|
||||||
if (this.d.cancelButton) {
|
if (this.d.cancelButton) {
|
||||||
this.click(this.d.cancelButton, 1);
|
this.click(this.d.cancelButton);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.dismiss('backdrop');
|
this.dismiss('backdrop');
|
||||||
|
@ -94,7 +94,7 @@ export class AlertCmp {
|
|||||||
constructor(
|
constructor(
|
||||||
public _viewCtrl: ViewController,
|
public _viewCtrl: ViewController,
|
||||||
public _elementRef: ElementRef,
|
public _elementRef: ElementRef,
|
||||||
public _config: Config,
|
config: Config,
|
||||||
gestureCtrl: GestureController,
|
gestureCtrl: GestureController,
|
||||||
params: NavParams,
|
params: NavParams,
|
||||||
private _renderer: Renderer,
|
private _renderer: Renderer,
|
||||||
@ -103,7 +103,7 @@ export class AlertCmp {
|
|||||||
// gesture blocker is used to disable gestures dynamically
|
// gesture blocker is used to disable gestures dynamically
|
||||||
this.gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
|
this.gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
|
||||||
this.d = params.data;
|
this.d = params.data;
|
||||||
this.mode = _config.get('mode');
|
this.mode = config.get('mode');
|
||||||
_renderer.setElementClass(_elementRef.nativeElement, `alert-${this.mode}`, true);
|
_renderer.setElementClass(_elementRef.nativeElement, `alert-${this.mode}`, true);
|
||||||
|
|
||||||
if (this.d.cssClass) {
|
if (this.d.cssClass) {
|
||||||
@ -233,7 +233,7 @@ export class AlertCmp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
btnClick(button: any, dismissDelay?: number) {
|
btnClick(button: any) {
|
||||||
if (!this.enabled) {
|
if (!this.enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -253,10 +253,7 @@ export class AlertCmp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shouldDismiss) {
|
if (shouldDismiss) {
|
||||||
setTimeout(() => {
|
this.dismiss(button.role);
|
||||||
this.dismiss(button.role);
|
|
||||||
}, dismissDelay || this._config.get('pageTransitionDelay'));
|
|
||||||
|
|
||||||
focusOutActiveElement();
|
focusOutActiveElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -288,7 +285,7 @@ export class AlertCmp {
|
|||||||
if (this.enabled && this.d.enableBackdropDismiss) {
|
if (this.enabled && this.d.enableBackdropDismiss) {
|
||||||
let cancelBtn = this.d.buttons.find(b => b.role === 'cancel');
|
let cancelBtn = this.d.buttons.find(b => b.role === 'cancel');
|
||||||
if (cancelBtn) {
|
if (cancelBtn) {
|
||||||
this.btnClick(cancelBtn, 1);
|
this.btnClick(cancelBtn);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.dismiss('backdrop');
|
this.dismiss('backdrop');
|
||||||
|
@ -461,14 +461,14 @@ export class PickerCmp {
|
|||||||
constructor(
|
constructor(
|
||||||
private _viewCtrl: ViewController,
|
private _viewCtrl: ViewController,
|
||||||
private _elementRef: ElementRef,
|
private _elementRef: ElementRef,
|
||||||
private _config: Config,
|
config: Config,
|
||||||
gestureCtrl: GestureController,
|
gestureCtrl: GestureController,
|
||||||
params: NavParams,
|
params: NavParams,
|
||||||
renderer: Renderer
|
renderer: Renderer
|
||||||
) {
|
) {
|
||||||
this._gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
|
this._gestureBlocker = gestureCtrl.createBlocker(BLOCK_ALL);
|
||||||
this.d = params.data;
|
this.d = params.data;
|
||||||
this.mode = _config.get('mode');
|
this.mode = config.get('mode');
|
||||||
renderer.setElementClass(_elementRef.nativeElement, `picker-${this.mode}`, true);
|
renderer.setElementClass(_elementRef.nativeElement, `picker-${this.mode}`, true);
|
||||||
|
|
||||||
if (this.d.cssClass) {
|
if (this.d.cssClass) {
|
||||||
@ -579,7 +579,7 @@ export class PickerCmp {
|
|||||||
this.enabled = true;
|
this.enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
btnClick(button: any, dismissDelay?: number) {
|
btnClick(button: any) {
|
||||||
if (!this.enabled) {
|
if (!this.enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -599,9 +599,7 @@ export class PickerCmp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shouldDismiss) {
|
if (shouldDismiss) {
|
||||||
setTimeout(() => {
|
this.dismiss(button.role);
|
||||||
this.dismiss(button.role);
|
|
||||||
}, dismissDelay || this._config.get('pageTransitionDelay'));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,15 +108,14 @@ import { isObject, isDefined, isFunction, isArray } from '../util/util';
|
|||||||
* | `menuType` | `string` | Type of menu to display. Available options: `"overlay"`, `"reveal"`, `"push"`. |
|
* | `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. |
|
* | `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. |
|
* | `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. |
|
* | `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. |
|
* | `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. |
|
* | `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. |
|
* | `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. |
|
* | `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. |
|
* | `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. |
|
* | `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"`. |
|
* | `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"` |
|
* | `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',
|
modalLeave: 'modal-slide-out',
|
||||||
|
|
||||||
pageTransition: 'ios-transition',
|
pageTransition: 'ios-transition',
|
||||||
pageTransitionDelay: 16,
|
|
||||||
|
|
||||||
pickerEnter: 'picker-slide-in',
|
pickerEnter: 'picker-slide-in',
|
||||||
pickerLeave: 'picker-slide-out',
|
pickerLeave: 'picker-slide-out',
|
||||||
@ -68,7 +67,6 @@ export const MODE_MD: any = {
|
|||||||
modalLeave: 'modal-md-slide-out',
|
modalLeave: 'modal-md-slide-out',
|
||||||
|
|
||||||
pageTransition: 'md-transition',
|
pageTransition: 'md-transition',
|
||||||
pageTransitionDelay: 64,
|
|
||||||
|
|
||||||
pickerEnter: 'picker-slide-in',
|
pickerEnter: 'picker-slide-in',
|
||||||
pickerLeave: 'picker-slide-out',
|
pickerLeave: 'picker-slide-out',
|
||||||
@ -112,7 +110,6 @@ export const MODE_WP: any = {
|
|||||||
modalLeave: 'modal-md-slide-out',
|
modalLeave: 'modal-md-slide-out',
|
||||||
|
|
||||||
pageTransition: 'wp-transition',
|
pageTransition: 'wp-transition',
|
||||||
pageTransitionDelay: 96,
|
|
||||||
|
|
||||||
pickerEnter: 'picker-slide-in',
|
pickerEnter: 'picker-slide-in',
|
||||||
pickerLeave: 'picker-slide-out',
|
pickerLeave: 'picker-slide-out',
|
||||||
|
Reference in New Issue
Block a user