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:
dana 2018-08-16 13:35:11 -07:00
commit e18f82b30c
4 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ If not, then provide details describing which page the feature will effect, e.g.
## 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

View File

@ -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.
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.

View File

@ -882,7 +882,7 @@ onDOMready().then(() => {
function restoreWindowScrollPos({immediately = true} = {}) {
if (!immediately) {
// run in the next microtask cycle
new Promise(() => restoreWindowScrollPos({immediately: true}));
Promise.resolve().then(restoreWindowScrollPos);
return;
}
if (window.scrollX !== state.scrollX || window.scrollY !== state.scrollY) {

View File

@ -788,8 +788,8 @@
const maxTopUnobscured = options.top <= maxTop ? maxTop : options.top - height - 20;
const maxRight = window.innerWidth - width;
const maxRightUnobscured = options.left <= maxRight ? maxRight : options.left - width;
const left = constrain(0, maxRightUnobscured, options.left);
const top = constrain(0, maxTopUnobscured, options.top);
const left = constrain(0, Math.max(0, maxRightUnobscured), options.left);
const top = constrain(0, Math.max(0, maxTopUnobscured), options.top);
$root.style.setProperty('left', left + 'px', 'important');
$root.style.setProperty('top', top + 'px', 'important');
}