Skip to content

Commit

Permalink
Emergency responsive fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwheeler committed Mar 25, 2014
1 parent 193f139 commit ccc380f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 8 deletions.
23 changes: 20 additions & 3 deletions js/slick.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ var mobileDetect = function() {
this.startLoad();
this.loadSlider();
this.intializeEvents();
this.checkResponsive();
}

};
Expand Down Expand Up @@ -425,7 +426,6 @@ var mobileDetect = function() {

slider.prototype.setPosition = function() {

this.checkResponsive();
this.setValues();
this.setDimensions();

Expand Down Expand Up @@ -485,7 +485,10 @@ var mobileDetect = function() {

$(window).on('orientationchange', this.setPosition);

$(window).on('resize', this.setPosition);
$(window).on('resize', function(){
self.checkResponsive();
self.setPosition();
});

$(window).on('load', this.setPosition);

Expand Down Expand Up @@ -956,7 +959,21 @@ var mobileDetect = function() {
this.slideOffset = 0;
this.swipeLeft = null;
this.list = null;
this.init();
this.touchObject = {};
this.transformsEnabled = false;

if (!$(this.slider).hasClass('slick-initialized')) {

$(this.slider).addClass('slick-initialized');
this.buildOut();
this.setValues();
this.getAnimType();
this.setPosition();
this.startLoad();
this.loadSlider();
this.intializeEvents();

}

}

Expand Down
2 changes: 1 addition & 1 deletion js/slick.min.js

Large diffs are not rendered by default.

23 changes: 20 additions & 3 deletions slick.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ var mobileDetect = function() {
this.startLoad();
this.loadSlider();
this.intializeEvents();
this.checkResponsive();
}

};
Expand Down Expand Up @@ -425,7 +426,6 @@ var mobileDetect = function() {

slider.prototype.setPosition = function() {

this.checkResponsive();
this.setValues();
this.setDimensions();

Expand Down Expand Up @@ -485,7 +485,10 @@ var mobileDetect = function() {

$(window).on('orientationchange', this.setPosition);

$(window).on('resize', this.setPosition);
$(window).on('resize', function(){
self.checkResponsive();
self.setPosition();
});

$(window).on('load', this.setPosition);

Expand Down Expand Up @@ -956,7 +959,21 @@ var mobileDetect = function() {
this.slideOffset = 0;
this.swipeLeft = null;
this.list = null;
this.init();
this.touchObject = {};
this.transformsEnabled = false;

if (!$(this.slider).hasClass('slick-initialized')) {

$(this.slider).addClass('slick-initialized');
this.buildOut();
this.setValues();
this.getAnimType();
this.setPosition();
this.startLoad();
this.loadSlider();
this.intializeEvents();

}

}

Expand Down
2 changes: 1 addition & 1 deletion slick.min.js

Large diffs are not rendered by default.

0 comments on commit ccc380f

Please sign in to comment.