roundabout icon indicating copy to clipboard operation
roundabout copied to clipboard

Add "destroy" method

Open mattstauffer opened this issue 12 years ago • 4 comments

Per conversations here: https://github.com/fredhq/roundabout/issues/56#issuecomment-9463306 , I added a "destroy" method that un-binds the Roundabout code and returns the element to its original state.

mattstauffer avatar Oct 15 '12 21:10 mattstauffer

thanks @mattstauffer - this worked perfect for a responsive site i'm working on when needing to re-init at a certain screen size

retlehs avatar Dec 17 '12 15:12 retlehs

This throws errors if autoplay and responsive are enabled due to the stopAutoplay and relayoutChildren methods trying to access non-existant .data("roundabout").

matthewhall avatar Apr 16 '13 09:04 matthewhall

Hey Matt, That's great! Could you do a pull request and I'll bring it into this fork?

Thanks, -matt

On Tue, Apr 16, 2013 at 4:37 AM, Matt Hall [email protected] wrote:

This seems to throw a JS error when autoplay is enabled. I fixed by adding this to your destroy method:

// Clear autoplay timersclearTimeout(data.autoplayStartTimeout);clearInterval(data.autoplayInterval);

Just after:

// Unbind window listeners$(window).unbind(".roundabout");

Thanks.

— Reply to this email directly or view it on GitHubhttps://github.com/fredhq/roundabout/pull/73#issuecomment-16435263 .

mattstauffer avatar Apr 16 '13 13:04 mattstauffer

Sure. I adjusted my original comment as the "fix" I'd provided didn't quite work.

I think I've fixed it properly now. Will provide a pull request once I've properly tested it.

Thanks.

matthewhall avatar Apr 16 '13 14:04 matthewhall