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

Commit

Permalink
Remove a button position fix that's no longer needed. (#4008)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba committed Jan 29, 2018
1 parent 2759fa5 commit b956bf7
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions addon/webextension/selector/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,27 +638,6 @@ this.ui = (function() { // eslint-disable-line no-unused-vars
window.addEventListener('scroll', watchFunction(assertIsTrusted(this.windowChangeStop)));
window.addEventListener('resize', watchFunction(assertIsTrusted(this.windowChangeStop)));
}

if (!(this.isElementInViewport(this.buttons))) {
this.cancel.style.position = this.download.style.position = "fixed";
this.cancel.style.left = (pos.left - 50) + "px";
this.download.style.left = ((pos.left - 100)) + "px";
this.cancel.style.top = this.download.style.top = `${pos.top}px`;
if (this.save) {
this.save.style.position = "fixed";
this.save.style.left = (pos.left - 190) + "px";
this.save.style.top = `${pos.top}px`;
}
} else {
this.cancel.style.position = this.download.style.position = "initial";
this.cancel.style.top = this.download.style.top = 0;
this.cancel.style.left = this.download.style.left = 0;
if (this.save) {
this.save.style.position = "initial";
this.save.style.top = 0;
this.save.style.left = 0;
}
}
},

// used to eventually move the download-only warning
Expand Down Expand Up @@ -733,7 +712,6 @@ this.ui = (function() { // eslint-disable-line no-unused-vars
if (save) {
buttons.appendChild(save);
}
this.buttons = buttons;
this.cancel = cancel;
this.download = download;
this.copy = copy;
Expand Down Expand Up @@ -802,11 +780,6 @@ this.ui = (function() { // eslint-disable-line no-unused-vars
return false;
},

isElementInViewport(el) {
let rect = el.getBoundingClientRect();
return (rect.right <= window.innerWidth);
},

clearSaveDisabled() {
if (!this.save) {
// Happens if we try to remove the disabled status after the worker
Expand Down

0 comments on commit b956bf7

Please sign in to comment.