zurb / joyride

jQuery feature tour plugin.
http://www.zurb.com/playground/jquery-joyride-feature-tour-plugin
1.42k stars 241 forks source link

Issue with Joyride on Drupal platform #113

Open NenadP opened 11 years ago

NenadP commented 11 years ago

There is an Drupal module that provides Joyride backend for Drupal. I have issue described here:http://drupal.org/node/1944356#comment-7368560.

Issue affects ability to autostart tour, and to have tour play once.

Proposed solution is a "hack" to initialize joyride twice via implementation in Drupal context module $('ol#joyride-tips-content',context).joyride(joyride_options);

It is dirty, but when called twice joyride will autostart, but will throw errors when tour is played once and page visited again (cookie is in place, and script is executed against it, and I got Uncaught TypeError: Cannot read property 'top' of null, and also hidden_corners.length was complaining; as a quick solution, I modified the jquery.joyride.js adding check if properties/methods exist. I would like feedbak if this is safe (it appears it is working)

This begins about line 768:

 if (el.offset() !== null) {
        return [    
          el.offset().top < top,
          right < el.offset().left + el.outerWidth(),
          bottom < el.offset().top + el.outerHeight(),
          w.scrollLeft() > el.offset().left    
                  ];
            }
      },
      visible : function (hidden_corners) { 
          if (hidden_corners !== undefined) { 
        var i = hidden_corners.length;
        while (i--) {
          if (hidden_corners[i]) return false;
        }
   }
        return true;
},
davereid commented 11 years ago

Solution for autostarting is in https://drupal.org/node/1944356#comment-7418082