From 69c37268a1e2a2ae19c62d34cd88fc167cba7bd2 Mon Sep 17 00:00:00 2001 From: Hyunje Alex Jun Date: Thu, 14 Mar 2013 15:46:12 +0900 Subject: [PATCH] Apply jshint. --- src/perfect-scrollbar.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index 12b9b94..be056dd 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -49,19 +49,19 @@ content_height, scrollbar_x_width, scrollbar_x_left, - scrollbar_x_bottom = parseInt($scrollbar_x.css('bottom')), + scrollbar_x_bottom = parseInt($scrollbar_x.css('bottom'), 10), scrollbar_y_height, scrollbar_y_top, - scrollbar_y_right = parseInt($scrollbar_y.css('right')); + scrollbar_y_right = parseInt($scrollbar_y.css('right'), 10); var updateContentScrollTop = function() { - var scroll_top = parseInt(scrollbar_y_top * content_height / container_height); + var scroll_top = parseInt(scrollbar_y_top * content_height / container_height, 10); $this.scrollTop(scroll_top); $scrollbar_x.css({bottom: scrollbar_x_bottom - scroll_top}); }; var updateContentScrollLeft = function() { - var scroll_left = parseInt(scrollbar_x_left * content_width / container_width); + var scroll_left = parseInt(scrollbar_x_left * content_width / container_width, 10); $this.scrollLeft(scroll_left); $scrollbar_y.css({right: scrollbar_y_right - scroll_left}); }; @@ -72,8 +72,8 @@ content_width = $content.outerWidth(false); content_height = $content.outerHeight(false); if(container_width < content_width) { - scrollbar_x_width = parseInt(container_width * container_width / content_width); - scrollbar_x_left = parseInt($this.scrollLeft() * container_width / content_width); + scrollbar_x_width = parseInt(container_width * container_width / content_width, 10); + scrollbar_x_left = parseInt($this.scrollLeft() * container_width / content_width, 10); } else { scrollbar_x_width = 0; @@ -81,8 +81,8 @@ $this.scrollLeft(0); } if(container_height < content_height) { - scrollbar_y_height = parseInt(container_height * container_height / content_height); - scrollbar_y_top = parseInt($this.scrollTop() * container_height / content_height); + scrollbar_y_height = parseInt(container_height * container_height / content_height, 10); + scrollbar_y_top = parseInt($this.scrollTop() * container_height / content_height, 10); } else { scrollbar_y_height = 0; @@ -186,26 +186,26 @@ var bindMouseWheelHandler = function() { var shouldPreventDefault = function(deltaX, deltaY) { var scrollTop = $this.scrollTop(); - if(scrollTop == 0 && deltaY > 0 && deltaX == 0) { - return !settings["wheelPropagation"]; + if(scrollTop === 0 && deltaY > 0 && deltaX === 0) { + return !settings.wheelPropagation; } - else if(scrollTop >= content_height - container_height && deltaY < 0 && deltaX == 0) { - return !settings["wheelPropagation"]; + else if(scrollTop >= content_height - container_height && deltaY < 0 && deltaX === 0) { + return !settings.wheelPropagation; } var scrollLeft = $this.scrollLeft(); - if(scrollLeft == 0 && deltaX < 0 && deltaY == 0) { - return !settings["wheelPropagation"]; + if(scrollLeft === 0 && deltaX < 0 && deltaY === 0) { + return !settings.wheelPropagation; } - else if(scrollLeft >= content_width - container_width && deltaX > 0 && deltaY == 0) { - return !settings["wheelPropagation"]; + else if(scrollLeft >= content_width - container_width && deltaX > 0 && deltaY === 0) { + return !settings.wheelPropagation; } return true; }; $this.mousewheel(function(e, delta, deltaX, deltaY) { - $this.scrollTop($this.scrollTop() - (deltaY * settings["wheelSpeed"])); - $this.scrollLeft($this.scrollLeft() + (deltaX * settings["wheelSpeed"])); + $this.scrollTop($this.scrollTop() - (deltaY * settings.wheelSpeed)); + $this.scrollLeft($this.scrollLeft() + (deltaX * settings.wheelSpeed)); // update bar position updateBarSizeAndPosition();