Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #173 from acconrad/patch-1
Browse files Browse the repository at this point in the history
Some minor linting fixes and cleanup
  • Loading branch information
garand committed Aug 18, 2015
2 parents 5002149 + 481a354 commit a0154df
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions jquery.sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
dwh = documentHeight - windowHeight,
extra = (scrollTop > dwh) ? dwh - scrollTop : 0;

for (var i = 0; i < sticked.length; i++) {
for (var i = 0, l = sticked.length; i < l; i++) {
var s = sticked[i],
elementTop = s.stickyWrapper.offset().top,
etse = elementTop - s.topSpacing - extra;
Expand Down Expand Up @@ -74,7 +74,7 @@
} else {
newTop = s.topSpacing;
}
if (s.currentTop != newTop) {
if (s.currentTop !== newTop) {
var newWidth;
if (s.getWidthFrom) {
newWidth = $(s.getWidthFrom).width() || null;
Expand Down Expand Up @@ -114,11 +114,11 @@
resizer = function() {
windowHeight = $window.height();

for (var i = 0; i < sticked.length; i++) {
for (var i = 0, l = sticked.length; i < l; i++) {
var s = sticked[i];
var newWidth = null;
if (s.getWidthFrom) {
if (s.responsiveWidth === true) {
if (s.responsiveWidth) {
newWidth = $(s.getWidthFrom).width();
}
} else if(s.widthFromWrapper) {
Expand All @@ -137,7 +137,7 @@

var stickyId = stickyElement.attr('id');
var stickyHeight = stickyElement.outerHeight();
var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName
var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName;
var wrapper = $('<div></div>')
.attr('id', wrapperId)
.addClass(o.wrapperClassName);
Expand All @@ -150,7 +150,7 @@
stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});
}

if (stickyElement.css("float") == "right") {
if (stickyElement.css("float") === "right") {
stickyElement.css({"float":"none"}).parent().css({"float":"right"});
}

Expand All @@ -177,7 +177,7 @@
removeIdx = i;
}
}
if(removeIdx != -1) {
if(removeIdx !== -1) {
unstickyElement.unwrap();
unstickyElement
.css({
Expand Down

0 comments on commit a0154df

Please sign in to comment.