• Robert Knight's avatar
    Fix adder position when document or body position is offset. · efbdc813
    Robert Knight authored
    Fix positioning of the adder when the document or body elements are
    positioned and offset relative to their default position.
    
    There were two problems:
    
     1. When converting from viewport to "document" coordinates, code in
        `adder.js` and `range-util.js` failed to account for the document
        element's position being offset from the default (0, 0) location.
     2. When setting the adder's top/left coords, `Adder#showAt`
        did not take into account the offset of the body element from the
        document.
    
    This commit fixes the issue by:
    
     1. Using viewport coordinates as far as possible in the range-util and
        Adder functions to reduce the need for converting coordinates.
    
     2. Calculating the position of the adder by comparing the target
        viewport coordinates for the adder and the viewport coordinates of
        the adder's nearest positioned ancestor.
    
    Fixes #487
    efbdc813
Name
Last commit
Last update
.github Loading commit data...
docs Loading commit data...
images Loading commit data...
scripts Loading commit data...
src Loading commit data...
.babelrc Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.travis.yml Loading commit data...
CHANGELOG.md Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
gulpfile.js Loading commit data...
package-lock.json Loading commit data...
package.json Loading commit data...
requirements-dev.in Loading commit data...
yarn.lock Loading commit data...