Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caroufredsel destroyed by calling add/remove/destroy methods on selectboxit. #181

Closed
jnwflash opened this issue Jun 18, 2013 · 1 comment
Assignees

Comments

@jnwflash
Copy link

Example:
$salaryPercentage is one of my select boxes...

I'm trying to use:
$salaryPercentage.data("selectBox-selectBoxIt").refresh();
or
$salaryPercentage.data("selectBox-selectBoxIt").add();
or
$salaryPercentage.data("selectBox-selectBoxIt").destroy();

to dynamically modify the available options of the selectboxit item.

Please note, this only happens when the selectboxit element is INSIDE the carousel slides. It does not happen when the selectboxit element is on the same page as a sibling.

When a selectboxit object is inside a caroufredsel carousel, calling any of the above methods destroys the entire caroufredsel carousel. The div is there but its no longer a carousel. Its likely a namespacing issue where a selectboxit event is bubbling up and causing a destroy on the carousel. For the record - the add/refresh/destroy events work fine - they do their job, but they destroy the carousel in the process.

Here's the carousel instantiation if it helps, and
$slider.carouFredSel({
auto: false,
width: "100%",
//prev: "#btnPrevious",
//next: "#btnNext, #btnNext2, #btnSkip",
items: 1,
scroll: {
items: 1,
fx: "scroll",
easing: "swing",
duration: 500
}
});

and the selectboxit instantiation (I've tried doing singular instantations as well)
if ($select.length > 0) {
$select.selectBoxIt({
aggressiveChange: true
});
}
*/

@ghost ghost assigned gfranko Jun 25, 2013
@gfranko
Copy link
Owner

gfranko commented Jun 25, 2013

The real issue is that the Caroufredsel plugin should be listening to a namespaced destroy event instead of just the standard destroy event. You should create an issue for that plugin.

In the meantime, I included a fix in the current release that makes sure that the destroy event triggered on the original select box does not bubble (thus not reaching the parent Caroufredsel slideshow element). Hope this helps!

@gfranko gfranko closed this as completed Jun 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants