I am still running into instances where the condition does not work out, so the condition is just getting longer and longer, there has to be a better way to do this.
What i has is this scenario
There is a space available for a user to choose
between 0, 1, 2, 3, 4 pieces of accommodation, and between 0, 1, 2, 3, 4 pieces of explore information.
If the user selects 4 of each then it looks like this
If the user selected 2 accommodations and 1 explore then it would look like this
Notice how the word EXPLORE has changed from position bottom left with the 3 dots EXPLORE… after the word to top right with … before the word, so …EXPLORE
I would like to find the most efficient method of showing or hiding the word EXPLORE considering how many possible outcomes there could be, and obviously never showing it in either position when there are 0 of them.
I have 2 divs with a show condition one for the top right and one for the bottom left and so far I have this silly looking idea in place.
<div class="text-right col-6" dmx-show="
(scViewItinerariesDetail.data.repeat_records_accom_acts_in_days[$index].query_available_act.count() != 0) ||
(scViewItinerariesDetail.data.repeat_records_accom_acts_in_days[$index].query_available_accom.count() == 3 && scViewItinerariesDetail.data.repeat_records_accom_acts_in_days[$index].query_available_act.count() == 1) ||
(scViewItinerariesDetail.data.repeat_records_accom_acts_in_days[$index].query_available_accom.count() == 2 && scViewItinerariesDetail.data.repeat_records_accom_acts_in_days[$index].query_available_act.count() == 2) ||
(scViewItinerariesDetail.data.repeat_records_accom_acts_in_days[$index].query_available_accom.count() == 1 && scViewItinerariesDetail.data.repeat_records_accom_acts_in_days[$index].query_available_act.count() == 3)">
...EXPLORE
</div>
And I am still coming across situations where EPLORE shows in the wrong place. Can someone that has maybe slept a little in the past 30 hours have a quick look, I assume there is a far far shorter simpler solution than this.
EDIT: I had it far shorter earlier using <=
and >=
but it still had instances where it was there when i didnt want it.