From de2b76641bb1cc67db5726bb969c187d8304a7ef Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Thu, 6 Mar 2014 10:20:38 +0200 Subject: [PATCH] Fix JSCS warnings. --- Gruntfile.js | 2 +- docs/assets/js/docs.js | 6 +++--- js/segmented-controllers.js | 2 +- js/toggles.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 5a76ebc..2b62856 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -39,7 +39,7 @@ module.exports = function(grunt) { clean: { dist: ['dist', 'docs/dist'] }, - + concat: { ratchet: { options: { diff --git a/docs/assets/js/docs.js b/docs/assets/js/docs.js index 637b14f..58584f7 100644 --- a/docs/assets/js/docs.js +++ b/docs/assets/js/docs.js @@ -51,7 +51,7 @@ $(function() { if (windowWidth >= 768) { device.initialLeft = device.offset().left; device.initialTop = device.initialTop || device.offset().top; - device.dockingOffset = ($(window).height() - device.height())/2; + device.dockingOffset = ($(window).height() - device.height()) / 2; } checkDesktopContent(); @@ -134,7 +134,7 @@ $(function() { var contentSectionItem; var currentTop = win.scrollTop(); - if((device.initialTop - currentTop) <= device.dockingOffset) { + if ((device.initialTop - currentTop) <= device.dockingOffset) { device[0].className = 'device device-fixed'; device.css({top: device.dockingOffset}); } else { @@ -175,7 +175,7 @@ $(function() { var currentTop = win.scrollTop(); var headerHeight = $('.docs-sub-header').outerHeight(); - if(currentTop >= headerHeight) { + if (currentTop >= headerHeight) { toolbarToggle.addClass('visible'); } else if (currentTop <= headerHeight) { toolbarToggle.removeClass('visible'); diff --git a/js/segmented-controllers.js b/js/segmented-controllers.js index ddef245..96ba988 100644 --- a/js/segmented-controllers.js +++ b/js/segmented-controllers.js @@ -58,4 +58,4 @@ }); window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} }); -}()); \ No newline at end of file +}()); diff --git a/js/toggles.js b/js/toggles.js index a7dd522..f07f903 100644 --- a/js/toggles.js +++ b/js/toggles.js @@ -76,7 +76,7 @@ handle.style.webkitTransform = 'translate3d(' + distanceX + 'px,0,0)'; - toggle.classList[(distanceX > (toggleWidth/2 - handleWidth/2)) ? 'add' : 'remove']('active'); + toggle.classList[(distanceX > (toggleWidth / 2 - handleWidth / 2)) ? 'add' : 'remove']('active'); }); window.addEventListener('touchend', function (e) { @@ -88,7 +88,7 @@ var toggleWidth = toggle.clientWidth; var handleWidth = handle.clientWidth; var offset = (toggleWidth - handleWidth); - var slideOn = (!touchMove && !toggle.classList.contains('active')) || (touchMove && (distanceX > (toggleWidth/2 - handleWidth/2))); + var slideOn = (!touchMove && !toggle.classList.contains('active')) || (touchMove && (distanceX > (toggleWidth / 2 - handleWidth / 2))); if (slideOn) { handle.style.webkitTransform = 'translate3d(' + offset + 'px,0,0)';