Browse Source

Fix JSCS warnings.

pull/436/head
XhmikosR 11 years ago
parent
commit
de2b76641b
  1. 6
      docs/assets/js/docs.js
  2. 4
      js/toggles.js

6
docs/assets/js/docs.js

@ -51,7 +51,7 @@ $(function() {
if (windowWidth >= 768) { if (windowWidth >= 768) {
device.initialLeft = device.offset().left; device.initialLeft = device.offset().left;
device.initialTop = device.initialTop || device.offset().top; device.initialTop = device.initialTop || device.offset().top;
device.dockingOffset = ($(window).height() - device.height())/2; device.dockingOffset = ($(window).height() - device.height()) / 2;
} }
checkDesktopContent(); checkDesktopContent();
@ -134,7 +134,7 @@ $(function() {
var contentSectionItem; var contentSectionItem;
var currentTop = win.scrollTop(); var currentTop = win.scrollTop();
if((device.initialTop - currentTop) <= device.dockingOffset) { if ((device.initialTop - currentTop) <= device.dockingOffset) {
device[0].className = 'device device-fixed'; device[0].className = 'device device-fixed';
device.css({top: device.dockingOffset}); device.css({top: device.dockingOffset});
} else { } else {
@ -175,7 +175,7 @@ $(function() {
var currentTop = win.scrollTop(); var currentTop = win.scrollTop();
var headerHeight = $('.docs-sub-header').outerHeight(); var headerHeight = $('.docs-sub-header').outerHeight();
if(currentTop >= headerHeight) { if (currentTop >= headerHeight) {
toolbarToggle.addClass('visible'); toolbarToggle.addClass('visible');
} else if (currentTop <= headerHeight) { } else if (currentTop <= headerHeight) {
toolbarToggle.removeClass('visible'); toolbarToggle.removeClass('visible');

4
js/toggles.js

@ -76,7 +76,7 @@
handle.style.webkitTransform = 'translate3d(' + distanceX + 'px,0,0)'; 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) { window.addEventListener('touchend', function (e) {
@ -88,7 +88,7 @@
var toggleWidth = toggle.clientWidth; var toggleWidth = toggle.clientWidth;
var handleWidth = handle.clientWidth; var handleWidth = handle.clientWidth;
var offset = (toggleWidth - handleWidth); 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) { if (slideOn) {
handle.style.webkitTransform = 'translate3d(' + offset + 'px,0,0)'; handle.style.webkitTransform = 'translate3d(' + offset + 'px,0,0)';

Loading…
Cancel
Save