mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
feat(queue): use stencil's queue controller for dom read/writes
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Component, Element, Event, EventEmitter, Method, Prop, State } from '@stencil/core';
|
||||
import { DomController, GestureDetail } from '../../index';
|
||||
import { GestureDetail, QueueController } from '../../index';
|
||||
|
||||
export const enum RefresherState {
|
||||
Inactive = 1 << 0,
|
||||
@ -30,7 +30,7 @@ export class Refresher {
|
||||
private progress = 0;
|
||||
private scrollEl: HTMLElement | null = null;
|
||||
|
||||
@Prop({ context: 'dom' }) dom: DomController;
|
||||
@Prop({ context: 'queue' }) queue: QueueController;
|
||||
|
||||
/**
|
||||
* The current state which the refresher is in. The refresher's states include:
|
||||
@ -335,7 +335,7 @@ export class Refresher {
|
||||
|
||||
private setCss(y: number, duration: string, overflowVisible: boolean, delay: string) {
|
||||
this.appliedStyles = (y > 0);
|
||||
this.dom.write(() => {
|
||||
this.queue.write(() => {
|
||||
if (this.scrollEl) {
|
||||
const style = this.scrollEl.style;
|
||||
style.transform = ((y > 0) ? 'translateY(' + y + 'px) translateZ(0px)' : 'translateZ(0px)');
|
||||
|
||||
Reference in New Issue
Block a user