feat(queue): use stencil's queue controller for dom read/writes

This commit is contained in:
Adam Bradley
2018-04-11 15:24:49 -05:00
parent 6a31f3960a
commit d623b3b71f
17 changed files with 75 additions and 145 deletions

View File

@ -1,5 +1,5 @@
import { Component, Element, Listen, Method, Prop } from '@stencil/core';
import { Config, DomController } from '../../index';
import { Config, QueueController } from '../../index';
@Component({
tag: 'ion-content',
@ -18,7 +18,7 @@ export class Content {
@Element() private el: HTMLElement;
@Prop({ context: 'config' }) config: Config;
@Prop({ context: 'dom' }) dom: DomController;
@Prop({ context: 'queue' }) queue: QueueController;
/**
* If true, the content will scroll behind the headers
@ -100,13 +100,13 @@ export class Content {
return;
}
if (this.fullscreen) {
this.dom.raf(() => {
this.dom.read(this.readDimensions.bind(this));
this.dom.write(this.writeDimensions.bind(this));
this.queue.read(() => {
this.queue.read(this.readDimensions.bind(this));
this.queue.write(this.writeDimensions.bind(this));
});
} else {
this.cTop = this.cBottom = -1;
this.dom.write(() => this.scrollEl && this.scrollEl.removeAttribute('style'));
this.queue.write(() => this.scrollEl && this.scrollEl.removeAttribute('style'));
}
}