Skip to content

Commit

Permalink
Remove white spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Nov 7, 2015
1 parent 8c418fd commit c9e258f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
12 changes: 6 additions & 6 deletions src/js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ s.controller = {
};
})();
},
//xxx: for now i will just save one spline function to to
//xxx: for now i will just save one spline function to to
getInterpolateFunction: function(c){
if(!s.controller.spline) s.controller.spline = s.params.loop ?
if(!s.controller.spline) s.controller.spline = s.params.loop ?
new s.controller.LinearSpline(s.slidesGrid, c.slidesGrid) :
new s.controller.LinearSpline(s.snapGrid, c.snapGrid);
},
Expand All @@ -52,20 +52,20 @@ s.controller = {
// this will create an Interpolate function based on the snapGrids
// x is the Grid of the scrolled scroller and y will be the controlled scroller
// it makes sense to create this only once and recall it for the interpolation
// the function does a lot of value caching for performance
// the function does a lot of value caching for performance
translate = c.rtl && c.params.direction === 'horizontal' ? -s.translate : s.translate;
if (s.params.controlBy === 'slide') {
s.controller.getInterpolateFunction(c);
// i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
// but it did not work out
controlledTranslate = -s.controller.spline.interpolate(-translate);
}

if(!controlledTranslate || s.params.controlBy === 'container'){
multiplier = (c.maxTranslate() - c.minTranslate()) / (s.maxTranslate() - s.minTranslate());
controlledTranslate = (translate - s.minTranslate()) * multiplier + c.minTranslate();
}

if (s.params.controlInverse) {
controlledTranslate = c.maxTranslate() - controlledTranslate;
}
Expand Down Expand Up @@ -98,7 +98,7 @@ s.controller = {
c.fixLoop();
}
c.onTransitionEnd();

});
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/js/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ s.effects = {
if (s.rtl) {
tx = -tx;
}

if (!isH()) {
ty = tx;
tx = 0;
}

var transform = 'rotateX(' + (isH() ? 0 : -slideAngle) + 'deg) rotateY(' + (isH() ? slideAngle : 0) + 'deg) translate3d(' + tx + 'px, ' + ty + 'px, ' + tz + 'px)';
if (progress <= 1 && progress > -1) {
wrapperRotate = i * 90 + progress * 90;
Expand Down Expand Up @@ -127,7 +127,7 @@ s.effects = {
'-ms-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
'transform-origin': '50% 50% -' + (s.size / 2) + 'px'
});

if (s.params.cube.shadow) {
if (isH()) {
cubeShadow.transform('translate3d(0px, ' + (s.width / 2 + s.params.cube.shadowOffset) + 'px, ' + (-s.width / 2) + 'px) rotateX(90deg) rotateZ(0deg) scale(' + (s.params.cube.shadowScale) + ')');
Expand Down
16 changes: 8 additions & 8 deletions src/js/lazy-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ s.lazy = {
if (typeof index === 'undefined') return;
if (typeof loadInDuplicate === 'undefined') loadInDuplicate = true;
if (s.slides.length === 0) return;

var slide = s.slides.eq(index);
var img = slide.find('.swiper-lazy:not(.swiper-lazy-loaded):not(.swiper-lazy-loading)');
if (slide.hasClass('swiper-lazy') && !slide.hasClass('swiper-lazy-loaded') && !slide.hasClass('swiper-lazy-loading')) {
Expand All @@ -29,15 +29,15 @@ s.lazy = {
else {
if (srcset) {
_img.attr('srcset', srcset);
_img.removeAttr('data-srcset');
_img.removeAttr('data-srcset');
}
if (src) {
_img.attr('src', src);
_img.attr('src', src);
_img.removeAttr('data-src');
}

}

_img.addClass('swiper-lazy-loaded').removeClass('swiper-lazy-loading');
slide.find('.swiper-lazy-preloader, .preloader').remove();
if (s.params.loop && loadInDuplicate) {
Expand All @@ -53,10 +53,10 @@ s.lazy = {
}
s.emit('onLazyImageReady', s, slide[0], _img[0]);
});

s.emit('onLazyImageLoad', s, slide[0], _img[0]);
});

},
load: function () {
var i;
Expand All @@ -72,7 +72,7 @@ s.lazy = {
}
}
else {
s.lazy.loadImageInSlide(s.activeIndex);
s.lazy.loadImageInSlide(s.activeIndex);
}
}
if (s.params.lazyLoadingInPrevNext) {
Expand Down
6 changes: 3 additions & 3 deletions src/js/parallax.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
function setParallaxTransform(el, progress) {
el = $(el);
var p, pX, pY;

p = el.attr('data-swiper-parallax') || '0';
pX = el.attr('data-swiper-parallax-x');
pY = el.attr('data-swiper-parallax-y');
Expand Down Expand Up @@ -35,12 +35,12 @@ function setParallaxTransform(el, progress) {
pY = pY * progress + 'px' ;
}
el.transform('translate3d(' + pX + ', ' + pY + ',0px)');
}
}
s.parallax = {
setTranslate: function () {
s.container.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){
setParallaxTransform(this, s.progress);

});
s.slides.each(function () {
var slide = $(this);
Expand Down
10 changes: 5 additions & 5 deletions src/js/scrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ s.scrollbar = {
var sb = s.scrollbar;
var x = 0, y = 0;
var translate;
var pointerPosition = isH() ?
var pointerPosition = isH() ?
((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageX : e.pageX || e.clientX) :
((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageY : e.pageY || e.clientY) ;
var position = (pointerPosition) - sb.track.offset()[isH() ? 'left' : 'top'] - sb.dragSize / 2;
Expand Down Expand Up @@ -94,7 +94,7 @@ s.scrollbar = {
sb.drag[0].style.width = '';
sb.drag[0].style.height = '';
sb.trackSize = isH() ? sb.track[0].offsetWidth : sb.track[0].offsetHeight;

sb.divider = s.size / s.virtualSize;
sb.moveDivider = sb.divider * (sb.trackSize / s.size);
sb.dragSize = sb.trackSize * sb.divider;
Expand Down Expand Up @@ -122,7 +122,7 @@ s.scrollbar = {
var sb = s.scrollbar;
var translate = s.translate || 0;
var newPos;

var newSize = sb.dragSize;
newPos = (sb.trackSize - sb.dragSize) * s.progress;
if (s.rtl && isH()) {
Expand All @@ -149,7 +149,7 @@ s.scrollbar = {
sb.drag.transform('translate3d(' + (newPos) + 'px, 0, 0)');
}
else {
sb.drag.transform('translateX(' + (newPos) + 'px)');
sb.drag.transform('translateX(' + (newPos) + 'px)');
}
sb.drag[0].style.width = newSize + 'px';
}
Expand All @@ -158,7 +158,7 @@ s.scrollbar = {
sb.drag.transform('translate3d(0px, ' + (newPos) + 'px, 0)');
}
else {
sb.drag.transform('translateY(' + (newPos) + 'px)');
sb.drag.transform('translateY(' + (newPos) + 'px)');
}
sb.drag[0].style.height = newSize + 'px';
}
Expand Down

0 comments on commit c9e258f

Please sign in to comment.