update TWA Management v0.0.1
This commit is contained in:
@ -28,10 +28,10 @@ export default class AElementFixed extends window.AObject {
|
||||
this._snapLoopId = null; // rAF: monitor chạm đáy CHA khi đang snap
|
||||
this._needIntroPose = true;// hiệu ứng intro khi snap
|
||||
this._snapWidth = null; // lock width (px) khi portal
|
||||
|
||||
this._isInit = false;
|
||||
this._bind();
|
||||
this._initObservers();
|
||||
this._onResize();
|
||||
|
||||
}
|
||||
|
||||
update(opts = {}) {
|
||||
@ -59,10 +59,17 @@ export default class AElementFixed extends window.AObject {
|
||||
|
||||
_onResize() {
|
||||
const desktop = window.innerWidth >= this.o.breakpoint;
|
||||
if (!desktop) {
|
||||
if (desktop) {
|
||||
if (!this._isInit) {
|
||||
this._initObservers();
|
||||
this._isInit = true;
|
||||
}
|
||||
} else {
|
||||
this._isInit = false;
|
||||
this._stopInViewLoop();
|
||||
this._stopSnapMonitor();
|
||||
this._unsnapAbsolute();
|
||||
this._teardownObservers();
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,7 +109,6 @@ export default class AElementFixed extends window.AObject {
|
||||
const vpBottom = e.rootBounds ? e.rootBounds.bottom : document.documentElement.clientHeight;
|
||||
const EPS = 0.75;
|
||||
if (e.isIntersecting) {
|
||||
console.log(e.target.style.bottom);
|
||||
if (e.target.style.bottom === '0px') {
|
||||
this._startInViewLoop();
|
||||
|
||||
@ -258,7 +264,7 @@ export default class AElementFixed extends window.AObject {
|
||||
this.el.style.left = '';
|
||||
this.el.style.top = '';
|
||||
this.el.style.bottom = '';
|
||||
|
||||
this.el.style.width = '';
|
||||
this._restoreToHostBeforeProbe();
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ export default class AMenu extends window.AObject {
|
||||
el.classList.remove("active");
|
||||
})
|
||||
} else {
|
||||
this.dropdown.closeDropdown();
|
||||
this.dropdown.checkCloseDropdown();
|
||||
}
|
||||
}).bind(this));
|
||||
}).bind(this), 100);
|
||||
|
||||
Reference in New Issue
Block a user