Merge remote-tracking branch 'upstream/master'
* upstream/master: ensure max>=min to keep colorpicker in view actually run restoreWindowScrollPos in a microtask no need to open issues that notify about transifex
This commit is contained in:
commit
e18f82b30c
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
|
@ -21,7 +21,7 @@ If not, then provide details describing which page the feature will effect, e.g.
|
||||||
|
|
||||||
## Adding translations
|
## Adding translations
|
||||||
|
|
||||||
You can help us translate the extension on [Transifex](https://www.transifex.com/github-7/Stylus). When `messages.json` file is ready to be merged, please open a new bug report in [stylus/issues](https://github.com/openstyles/stylus/issues).
|
You can help us translate the extension on [Transifex](https://www.transifex.com/github-7/Stylus).
|
||||||
|
|
||||||
## Pull requests
|
## Pull requests
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ Stylus is a fork of Stylish for Chrome, also compatible with Firefox as a WebExt
|
||||||
|
|
||||||
The source is hosted on [GitHub](https://github.com/openstyles/stylus) and pull requests are welcome.
|
The source is hosted on [GitHub](https://github.com/openstyles/stylus) and pull requests are welcome.
|
||||||
|
|
||||||
You can help us translate the extension on [Transifex](https://www.transifex.com/github-7/Stylus). When `messages.json` file is ready to be merged, please open a new bug report in [stylus/issues](https://github.com/openstyles/stylus/issues).
|
You can help us translate the extension on [Transifex](https://www.transifex.com/github-7/Stylus).
|
||||||
|
|
||||||
See our [contributing](./.github/CONTRIBUTING.md) page for more details.
|
See our [contributing](./.github/CONTRIBUTING.md) page for more details.
|
||||||
|
|
||||||
|
|
|
@ -882,7 +882,7 @@ onDOMready().then(() => {
|
||||||
function restoreWindowScrollPos({immediately = true} = {}) {
|
function restoreWindowScrollPos({immediately = true} = {}) {
|
||||||
if (!immediately) {
|
if (!immediately) {
|
||||||
// run in the next microtask cycle
|
// run in the next microtask cycle
|
||||||
new Promise(() => restoreWindowScrollPos({immediately: true}));
|
Promise.resolve().then(restoreWindowScrollPos);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (window.scrollX !== state.scrollX || window.scrollY !== state.scrollY) {
|
if (window.scrollX !== state.scrollX || window.scrollY !== state.scrollY) {
|
||||||
|
|
|
@ -788,8 +788,8 @@
|
||||||
const maxTopUnobscured = options.top <= maxTop ? maxTop : options.top - height - 20;
|
const maxTopUnobscured = options.top <= maxTop ? maxTop : options.top - height - 20;
|
||||||
const maxRight = window.innerWidth - width;
|
const maxRight = window.innerWidth - width;
|
||||||
const maxRightUnobscured = options.left <= maxRight ? maxRight : options.left - width;
|
const maxRightUnobscured = options.left <= maxRight ? maxRight : options.left - width;
|
||||||
const left = constrain(0, maxRightUnobscured, options.left);
|
const left = constrain(0, Math.max(0, maxRightUnobscured), options.left);
|
||||||
const top = constrain(0, maxTopUnobscured, options.top);
|
const top = constrain(0, Math.max(0, maxTopUnobscured), options.top);
|
||||||
$root.style.setProperty('left', left + 'px', 'important');
|
$root.style.setProperty('left', left + 'px', 'important');
|
||||||
$root.style.setProperty('top', top + 'px', 'important');
|
$root.style.setProperty('top', top + 'px', 'important');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user