Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
fixed #2453 comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycoates committed Mar 22, 2017
1 parent d4bc0c6 commit 0c537e7
Showing 1 changed file with 5 additions and 31 deletions.
36 changes: 5 additions & 31 deletions addon/webextension/selector/ui.js
Expand Up @@ -72,7 +72,6 @@ window.ui = (function () { // eslint-disable-line no-unused-vars
sizeTracking: {
timer: null,
windowDelayer: null,
resizeBound: null,
lastHeight: null,
lastWidth: null
},
Expand Down Expand Up @@ -207,10 +206,7 @@ window.ui = (function () { // eslint-disable-line no-unused-vars
element: null,
document: null,
sizeTracking: {
windowDelayer: null,
resizeBound: null,
lastHeight: null,
lastWidth: null
windowDelayer: null
},
display: function (installHandlerOnDocument, standardOverlayCallbacks) {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -279,31 +275,9 @@ window.ui = (function () { // eslint-disable-line no-unused-vars
});
},

updateElementSize: function (force) {
// Note: if someone sizes down the page, then the iframe will keep the
// document from naturally shrinking. We use force to temporarily hide
// the element so that we can tell if the document shrinks
const visible = this.element.style.display !== "none";
if (force && visible) {
this.element.style.display = "none";
}
let height = Math.max(
document.documentElement.clientHeight,
window.innerHeight);
if (height !== this.sizeTracking.lastHeight) {
this.sizeTracking.lastHeight = height;
this.element.style.height = height + "px";
}
let width = Math.max(
document.documentElement.clientWidth,
window.innerWidth);
if (width !== this.sizeTracking.lastWidth) {
this.sizeTracking.lastWidth = width;
this.element.style.width = width + "px";
}
if (force && visible) {
this.element.style.display = "";
}
updateElementSize: function () {
this.element.style.height = window.innerHeight + "px";
this.element.style.width = window.innerWidth + "px";
},

hide: function () {
Expand Down Expand Up @@ -348,7 +322,7 @@ window.ui = (function () { // eslint-disable-line no-unused-vars
currentIframe: iframePreSelection,
display: function (installHandlerOnDocument, standardOverlayCallbacks) {
return iframeSelection.display(installHandlerOnDocument)
.then(() => iframePreSelection.display(installHandlerOnDocument, standardOverlayCallbacks))
.then(() => iframePreSelection.display(installHandlerOnDocument, standardOverlayCallbacks));
},

hide: function () {
Expand Down

0 comments on commit 0c537e7

Please sign in to comment.