Browse Source

Fix JSCS warnings.

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

2
Gruntfile.js

@ -39,7 +39,7 @@ module.exports = function(grunt) {
clean: { clean: {
dist: ['dist', 'docs/dist'] dist: ['dist', 'docs/dist']
}, },
concat: { concat: {
ratchet: { ratchet: {
options: { options: {

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');

2
js/segmented-controllers.js

@ -58,4 +58,4 @@
}); });
window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} }); window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} });
}()); }());

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