mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
remove some uses of rafPromise
For simple internal raf, a callback would be better. Once less zone fired change detection.
This commit is contained in:
@ -18,7 +18,7 @@ import {Parent} from 'angular2/src/core/annotations_impl/visibility';
|
|||||||
import {Item, Icon} from 'ionic/ionic'
|
import {Item, Icon} from 'ionic/ionic'
|
||||||
import {Ionic} from 'ionic/components/app/app'
|
import {Ionic} from 'ionic/components/app/app'
|
||||||
import {IonicComponent} from 'ionic/config/component'
|
import {IonicComponent} from 'ionic/config/component'
|
||||||
import {raf, rafPromise, ready} from 'ionic/util/dom'
|
import {raf, ready} from 'ionic/util/dom'
|
||||||
import * as util from 'ionic/util'
|
import * as util from 'ionic/util'
|
||||||
|
|
||||||
import {Animation} from 'ionic/animations/animation';
|
import {Animation} from 'ionic/animations/animation';
|
||||||
|
@ -106,7 +106,7 @@ class Slideable {
|
|||||||
isOpen(open: Boolean) {
|
isOpen(open: Boolean) {
|
||||||
if (arguments.length && open !== this._isOpen) {
|
if (arguments.length && open !== this._isOpen) {
|
||||||
this.isTransitionActive(true)
|
this.isTransitionActive(true)
|
||||||
dom.rafPromise().then(() => {
|
dom.raf(() => {
|
||||||
this.isOpen = isOpen
|
this.isOpen = isOpen
|
||||||
this.onSetIsOpen(open)
|
this.onSetIsOpen(open)
|
||||||
})
|
})
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {Animation} from '../animations/animation';
|
import {Animation} from '../animations/animation';
|
||||||
import {raf, rafPromise} from '../util/dom';
|
import {raf} from '../util/dom';
|
||||||
|
|
||||||
const SHOW_NAVBAR_CSS = 'show-navbar';
|
const SHOW_NAVBAR_CSS = 'show-navbar';
|
||||||
const SHOW_VIEW_CSS = 'show-view';
|
const SHOW_VIEW_CSS = 'show-view';
|
||||||
@ -49,10 +49,6 @@ export class Transition extends Animation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stage(callback) {
|
stage(callback) {
|
||||||
// if no callback was supplied then return a promise
|
|
||||||
if (!callback) {
|
|
||||||
return rafPromise();
|
|
||||||
}
|
|
||||||
raf(callback);
|
raf(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user