Skip to content

Commit db648a6

Browse files
committed
ESLint and JSCS fixes
1 parent 7ae6be0 commit db648a6

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

lib/web/mage/sticky.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,19 @@ define([
1717
stickyClass: '_sticky'
1818
},
1919

20+
/**
21+
* Retrieve option value
22+
* @param {String} option
23+
* @return {*}
24+
* @private
25+
*/
2026
_getOptionValue: function (option) {
2127
var value = this.options[option] || 0;
28+
2229
if (typeof value === 'function') {
2330
value = this.options[option]();
2431
}
32+
2533
return value;
2634
},
2735

@@ -46,7 +54,9 @@ define([
4654
*/
4755
_stick: function () {
4856
var offset,
49-
isStatic;
57+
isStatic,
58+
stuck,
59+
offsetTop;
5060

5161
isStatic = this.element.css('position') === 'static';
5262

@@ -57,14 +67,15 @@ define([
5767

5868
offset = Math.max(0, Math.min(offset, this.maxOffset));
5969

60-
var stuck = this.element.hasClass(this.options.stickyClass),
61-
offsetTop = this._getOptionValue('offsetTop');
70+
stuck = this.element.hasClass(this.options.stickyClass);
71+
offsetTop = this._getOptionValue('offsetTop');
72+
6273
if (offset && !stuck && offset < offsetTop) {
6374
offset = 0;
6475
}
6576

6677
this.element
67-
.toggleClass(this.options.stickyClass, (offset > 0))
78+
.toggleClass(this.options.stickyClass, offset > 0)
6879
.css('top', offset);
6980
}
7081
},

0 commit comments

Comments
 (0)