I have this problem I can’t solve alone, and I need to ask for your help.
Basically I would like to have a two panels, the first one is like a main filter, while the other one is a some kind of modifier.
<section class="primary-panel">
<p>Primary panel</p>
<ul class="primary-panel-wrapper">
<li class="primary-panel-item" data-foo="A">foo A</li>
<li class="primary-panel-item" data-foo="B">foo B</li>
<li class="primary-panel-item" data-foo="C">foo C</li>
</ul>
</section>
<section class="secondary-panel">
<p>Secondary panel</p>
<ul class="secondary-panel-wrapper">
<li class="secondary-panel-item" data-bar="A">bar A</li>
<li class="secondary-panel-item" data-bar="B">bar B</li>
<li class="secondary-panel-item" data-bar="C">bar C</li>
</ul>
</section>
So when I choose “foo A/B or C” the script filter those items, and it’s quite ok.
But when I choose the “modifier” (bar A/B or C) I would like to merge those those attributes together and display modified version, so I could get something like this “foobar AA/AB/AC/BA/BB/BC/CA/CB/CC”.
So basically when I choose “foo A” and then “bar A/B/C” I would like to get “foobar AA/AB/AC”, same for “foo B” -> ”foobar BA/BB/BC” and “foo C” -> “foobar CA/CB/CC” and so on.
I kind of accomplished this, but I always get AA/AB/AC no matter what I chose earlier (foo A/B or C), and it’s killing me.
If you have any idea how it could be solved I would appreciate it if you help me with this.
Here you'll find full fiddle:
http://jsfiddle.net/c0drbs2u/33/
Thanks in advance.