Skip to content

Commit e6795cb

Browse files
committed
Better code readability
1 parent 5071e54 commit e6795cb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/web/mage/sticky.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,10 @@ define([
5757

5858
offset = Math.max(0, Math.min(offset, this.maxOffset));
5959

60-
var stuck = this.element.hasClass(this.options.stickyClass);
61-
if (offset && this.options.offsetTop && !stuck) {
62-
var offsetTop = this._getOptionValue('offsetTop');
63-
if (offset < offsetTop) {
64-
offset = 0;
65-
}
60+
var stuck = this.element.hasClass(this.options.stickyClass),
61+
offsetTop = this._getOptionValue('offsetTop');
62+
if (offset && !stuck && offset < offsetTop) {
63+
offset = 0;
6664
}
6765

6866
this.element

0 commit comments

Comments
 (0)