]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commit
Create relative scope detection & use the relative parent to adjust the calculation
authorSassNinja <kai.falkowski@gmail.com>
Thu, 1 Jun 2017 09:27:42 +0000 (11:27 +0200)
committerSassNinja <kai.falkowski@gmail.com>
Thu, 1 Jun 2017 09:27:42 +0000 (11:27 +0200)
commitf62f24fd006c96cf9e1ed23149edef3a5cf2e044
tree7c2e0f40984975d2e3e7e2cc2ab7e1f8a3de00ce
parentba89035200894e75230f914d78e0ab17af5f63da
Create relative scope detection & use the relative parent to adjust the calculation

If a nested off-canvas element is placed in a container with position:relative (mostly push/pull classes) this must be considered in the calculation of the fixed position emulation.
To detect the relative scope I'm checking if the closest positioned element (offsetParent) has a left css value (typical for push/pull) or is affecting the top coord.
The usage of adjustToLocalScope() is limited to nested elements because non-nested elements doesn't have that scope issue (due to position:fixed)
js/foundation.offcanvas.js