Hello Russian-dima,
So, I both added the console logs, and used the user interface to add an onItemReady event. Doing so, the repeater works, the console logs are showing what I expect, and the correct icons are now being hidden.
However, this solution only works for the single editing session where I initiate the onItemReady event. If I save, log out, and then return, the onItemReady event is not triggered, no console logs are shown, and none of the icons are hidden. I can get it working again by creating a new event through the user interface, but then it stops working when I save, log out, and then return.
I figured that I could try to get around this by going back to initiating the event through the code using:
$w ( “#repeater1” ). onItemReady ( ( $w , itemData , index ) => { code goes here}
but under all circumstance it seems to not be triggered when using this formulation of initiating an event.
I’ve included the code that works as expected for a single session below. Any ideas on how to get this event to be “remembered” between sessions and be triggered? What is going on here?
-------------------------------code--------------------------------------
export function repeater1_itemReady($w, itemData, index) {
// This function was added from the Properties & Events panel. To learn more, visit Velo: Working with the Properties & Events Panel | Help Center | Wix.com
console.log(itemData.youtube)
console.log(itemData.pintrest)
console.log(itemData.instagram)
console.log(itemData.fb)
console.log(itemData.twitter)
console.log(itemData.linkedIn)
if (itemData.youtube === undefined) {
$w( “#image3” ).hide();
console.log( ‘youtube hidden ----------------------------------’ )
}
else {
$w( “#image3” ).show();
console.log( 'youtube Shown ----------------------------------’ )
*** I do this same if/else for the rest of the Social Media links ***
}