mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 778582 - Part 3: Automatically resize reader frame with contents. r=mfinkle
This commit is contained in:
parent
22b2022414
commit
3dccb93e89
@ -50,6 +50,8 @@ let AboutReader = {
|
||||
|
||||
this._scrollOffset = window.pageYOffset;
|
||||
|
||||
this._frame.contentDocument.addEventListener("DOMSubtreeModified", this, false);
|
||||
this._frame.contentDocument.addEventListener("MozScrolledAreaChanged", this, false);
|
||||
this._frame.contentDocument.addEventListener("touchstart", this, false);
|
||||
this._frame.contentDocument.addEventListener("click", this, false);
|
||||
window.addEventListener("scroll", this, false);
|
||||
@ -131,6 +133,13 @@ let AboutReader = {
|
||||
case "resize":
|
||||
this._updateImageMargins();
|
||||
break;
|
||||
case "DOMSubtreeModified":
|
||||
case "MozScrolledAreaChanged":
|
||||
let newHeight = this._frame.contentDocument.body.offsetHeight + "px";
|
||||
if (this._frame.style.height != newHeight) {
|
||||
this._frame.style.height = newHeight;
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
@ -141,6 +150,8 @@ let AboutReader = {
|
||||
|
||||
this._frame.contentDocument.removeEventListener("touchstart", this, false);
|
||||
this._frame.contentDocument.removeEventListener("click", this, false);
|
||||
this._frame.contentDocument.removeEventListener("DOMSubtreeModified", this, false);
|
||||
this._frame.contentDocument.removeEventListener("MozScrolledAreaChanged", this, false);
|
||||
window.removeEventListener("scroll", this, false);
|
||||
window.removeEventListener("popstate", this, false);
|
||||
window.removeEventListener("resize", this, false);
|
||||
|
Loading…
Reference in New Issue
Block a user