rails_onboarding 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 968d937235787bd7b4b096707cd9e44f2152d11c5b9d6f92f8f684d4b0807e98
|
|
4
|
+
data.tar.gz: f3b564a235899a551598ae48c9877ef5090261240a9e5b33cf0f63af6c155fc4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 35466bcb9f4c22021d9a8012cb4f0fc0bf3a2b3ccaeedf270f0681711d1a686e41b6a3e102b6a5084955ca7b0c2bc5ad84203b284303604b1e27c5c93a032a58
|
|
7
|
+
data.tar.gz: 1674b9b08636d82c3d71fb78b80d8aae49d7f7510f91ff948dbbf642c79ddf21118248d465bce33b84e5630c24ee37b04cdfc2d30542047cc50fa2469210babd
|
|
@@ -149,8 +149,8 @@ export default class extends Controller {
|
|
|
149
149
|
</div>
|
|
150
150
|
`
|
|
151
151
|
|
|
152
|
-
// Position tooltip (top/left are
|
|
153
|
-
//
|
|
152
|
+
// Position tooltip (top/left are computed per call, so they stay inline;
|
|
153
|
+
// everything else lives in .step-tooltip)
|
|
154
154
|
document.body.appendChild(tooltip)
|
|
155
155
|
this.positionTooltip(tooltip, targetElement)
|
|
156
156
|
|
|
@@ -179,8 +179,12 @@ export default class extends Controller {
|
|
|
179
179
|
top = rect.top - tooltipRect.height - 8
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
// The maths above is all in viewport space (getBoundingClientRect,
|
|
183
|
+
// window.innerWidth/Height), but .step-tooltip is `position: absolute`
|
|
184
|
+
// on document.body, so add the scroll offset when applying. See the same
|
|
185
|
+
// conversion in tooltip_controller.js#positionTooltip.
|
|
186
|
+
tooltip.style.top = `${top + window.scrollY}px`
|
|
187
|
+
tooltip.style.left = `${left + window.scrollX}px`
|
|
184
188
|
}
|
|
185
189
|
|
|
186
190
|
// Advance to next step (for testing/demo purposes)
|
|
@@ -784,9 +784,16 @@ export default class extends Controller {
|
|
|
784
784
|
|
|
785
785
|
let { position, top, left, arrowPosition } = bestPosition
|
|
786
786
|
|
|
787
|
-
// Apply position
|
|
788
|
-
|
|
789
|
-
|
|
787
|
+
// Apply position, converting viewport coordinates to document ones.
|
|
788
|
+
// Everything above - getBoundingClientRect, the edge clamping in
|
|
789
|
+
// calculatePosition, the collision checks in scorePosition - works in
|
|
790
|
+
// viewport space, but .onboarding-tooltip is `position: absolute` on
|
|
791
|
+
// document.body, so top/left are resolved against the document. Without
|
|
792
|
+
// the scroll offset the tooltip lands a full scroll position away from
|
|
793
|
+
// its trigger. Absolute (not fixed) is deliberate: it keeps the tooltip
|
|
794
|
+
// glued to the trigger if the page scrolls while it's open.
|
|
795
|
+
this.tooltip.style.top = `${top + viewport.scrollY}px`
|
|
796
|
+
this.tooltip.style.left = `${left + viewport.scrollX}px`
|
|
790
797
|
|
|
791
798
|
// Style arrow based on final position
|
|
792
799
|
if (arrow) {
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_onboarding
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Lewis
|
|
@@ -282,7 +282,7 @@ licenses:
|
|
|
282
282
|
metadata:
|
|
283
283
|
allowed_push_host: https://rubygems.org
|
|
284
284
|
homepage_uri: https://github.com/bunnahabhain/rails_onboarding
|
|
285
|
-
source_code_uri: https://github.com/bunnahabhain/rails_onboarding/tree/v0.8.
|
|
285
|
+
source_code_uri: https://github.com/bunnahabhain/rails_onboarding/tree/v0.8.1
|
|
286
286
|
changelog_uri: https://github.com/bunnahabhain/rails_onboarding/blob/master/docs/CHANGELOG.md
|
|
287
287
|
rdoc_options: []
|
|
288
288
|
require_paths:
|