Skip to content

Commit edfec61

Browse files
committed
maint(pat bumper): Minor code cleanup.
1 parent c04ea75 commit edfec61

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/pat/bumper/bumper.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,28 +60,28 @@ export default Base.extend({
6060
bottom: dom.get_css_value(this.el, "bottom", true),
6161
left: dom.get_css_value(this.el, "left", true),
6262
};
63-
const intersection_observer_config_y = {
63+
const intersection_observer_config = {
6464
threshold: [1, 0.99, 0.97, 0.96, 0.95, 0.94, 0.93, 0.92, 0.91, 0.9],
65-
root: scroll_container_y,
6665
// add margin as inverted sticky positions.
6766
rootMargin: `${-pos.top - 1}px ${-pos.right - 1}px ${-pos.bottom - 1}px ${-pos.left - 1}px`, // prettier-ignore
6867
};
6968

7069
const observer_y = new IntersectionObserver(
7170
this._intersection_observer_callback.bind(this),
72-
intersection_observer_config_y
71+
{
72+
...intersection_observer_config,
73+
root: scroll_container_y,
74+
}
7375
);
7476
observer_y.observe(this.el);
7577

7678
if (scroll_container_x !== scroll_container_y) {
77-
const intersection_observer_config_x = Object.assign(
78-
{},
79-
intersection_observer_config_y,
80-
{ root: scroll_container_x }
81-
);
8279
const observer_x = new IntersectionObserver(
8380
this._intersection_observer_callback.bind(this),
84-
intersection_observer_config_x
81+
{
82+
...intersection_observer_config,
83+
root: scroll_container_x,
84+
}
8585
);
8686
observer_x.observe(this.el);
8787
}

src/pat/bumper/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
<div id="spacer">
8989
Making some space to the left
9090
</div>
91-
<div class="pat-bumper bumper-2" data-pat-bumper="margin: 20; side: all">
91+
<div class="pat-bumper bumper-2">
9292
Sticky bar.
9393
</div>
9494
<p>

0 commit comments

Comments
 (0)