From 260ba74920623cbe7606303cc0618f96d6a73901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bareyre?= Date: Tue, 28 Jun 2016 11:05:08 +0200 Subject: [PATCH 1/2] [*] MO : improvement on homeslider module with one slide Disable controls and auto loop when there is only one slide on homeslider module --- js/homeslider.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/homeslider.js b/js/homeslider.js index 0287c17..4897f9b 100644 --- a/js/homeslider.js +++ b/js/homeslider.js @@ -35,7 +35,7 @@ $(document).ready(function(){ if (typeof(homeslider_width) == 'undefined') homeslider_width = 779; - + var slideCount = $('#homeslider li').length; if (!!$.prototype.bxSlider) $('#homeslider').bxSlider({ useCSS: false, @@ -45,10 +45,10 @@ $(document).ready(function(){ hideControlOnEnd: true, pager: false, autoHover: true, - auto: homeslider_loop, + auto: (slideCount>1?homeslider_loop:0), speed: parseInt(homeslider_speed), pause: homeslider_pause, - controls: true + controls: slideCount>1?true:false) }); $('.homeslider-description').click(function () { @@ -59,4 +59,4 @@ $(document).ready(function(){ $('#homepage-slider').addClass('col-xs-8'); else $('#homepage-slider').addClass('col-xs-12'); -}); \ No newline at end of file +}); From 8d1c1f029ec9039f62fd2ced9fc9a5ce7da9eb88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bareyre?= Date: Tue, 28 Jun 2016 11:21:17 +0200 Subject: [PATCH 2/2] fix parentesis missing --- js/homeslider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/homeslider.js b/js/homeslider.js index 4897f9b..7207bb1 100644 --- a/js/homeslider.js +++ b/js/homeslider.js @@ -48,7 +48,7 @@ $(document).ready(function(){ auto: (slideCount>1?homeslider_loop:0), speed: parseInt(homeslider_speed), pause: homeslider_pause, - controls: slideCount>1?true:false) + controls: (slideCount>1?true:false) }); $('.homeslider-description').click(function () {