Download & Extend

timeout value should be casted to an int in views_slideshow.js

Project:Views Slideshow
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

This bug is only triggered when using a timeout value of 0. When using a 0 value in combination with next or prev settings to the jquery cycle plugin this should normally make the slideshow become fully manual (requiring the user to click 'next' / 'prev' buttons). However, if you set this to 0 in views_slideshow, the slideshow actually just starts switching very rapidly. I believe this is due to the value in settings.timeout being a string, not an int. When I cast it to an int it seems to work as it should.

This is the code in question:

    var settings = Drupal.settings.viewsSlideshowThumbnailHover[fullId];
    settings.targetId = '#' + $(fullId + " :first").attr('id');
    settings.opts = {
      fx:settings.effect,
      speed:settings.speed,
      timeout:settings.timeout,

The attached patch fixes this by simply adding parseInt(settings.timeout).

AttachmentSize
views_slideshow_timeout_int.patch961 bytes

Comments

#1

Status:needs review» reviewed & tested by the community

I can verify that this fixes the issue. I will commit as soon as I get a couple of other items committed.

#2

Status:reviewed & tested by the community» fixed

Committed this. Thanks a lot!!

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here