libLink
libLink copied to clipboard
Allow the removal of a specific link
first off... libLink and noUiSlider are awesome, thanks!
now for the issue; Suppose I've got a slider that I've got linked to many different elements, I need to remove one link, not all of them.
So for example:
I've got three sliders; slider1, slider2, and slider3. Each slider has two handles, lower and upper.
Now, each slider has a bunch of links: slider1 upper => slider2 lower slider2 lower => slider1 upper slider2 upper => slider3 lower slider3 lower => slider2 upper
in addition, each slider upper and lower link to a hidden input field and labels to display the value. (this means slider1 has 5 links, slider2 has 6 links, and slider3 has 5 links. Each of these links are built at different times during the application lifeline. the reason being, you can add and remove sliders.
Now, suppose I want to remove slider2 from the page, that's fine, I've come up with a way to relink the upper and lower handles for slider1 to slider3 and vice versa. But the issue comes when I then remove slider3... I can't simply update the upper link for slider1, I need to remove the link. I can't figure out how to remove a single link, I'd have to remove them all, at least that's what the documentation looks like. Maybe I missed something.
I hope I made sense!
You've made perfect sense, and this is a feature I'd like to add at some point. I'd have to come up with a way to ID specific Link's.
Two workarounds:
- have a quick look at the source, you could probably just remove a link directly from the slider object;
- remove all links, and write some abstract function that takes two sliders and links them together. This is likely the easiest way.
-----Original Message----- From: "jaimz22" [email protected] Sent: 2/20/2015 21:31 To: "leongersen/libLink" [email protected] Subject: [libLink] Allow the removal of a specific link (#3)
first off... libLink and noUiSlider are awesome, thanks! now for the issue; Suppose I've got a slider that I've got linked to many different elements, I need to remove one link, not all of them. So for example: I've got three sliders; slider1, slider2, and slider3. Each slider has two handles, lower and upper. Now, each slider has a bunch of links: slider1 upper => slider2 lower slider2 lower => slider1 upper slider2 upper => slider3 lower slider3 lower => slider2 upper
in addition, each slider upper and lower link to a hidden input field and labels to display the value. (this means slider1 has 5 links, slider2 has 6 links, and slider3 has 5 links. Each of these links are built at different times during the application lifeline. the reason being, you can add and remove sliders. Now, suppose I want to remove slider2 from the page, that's fine, I've come up with a way to relink the upper and lower handles for slider1 to slider3 and vice versa. But the issue comes when I then remove slider3... I can't simply update the upper link for slider1, I need to remove the link. I can't figure out how to remove a single link, I'd have to remove them all, at least that's what the documentation looks like. Maybe I missed something. I hope I made sense! — Reply to this email directly or view it on GitHub.