clearVisited() Function
January 27, 2021
clearVisited() Function
January 27, 2021
Newbie 3 posts
Followers: 0 people

Hello,

I’m attempting to reset all status flags in the TOC when entering a specific slide.  I’d like to use JS to call the clearVisited function, but I feel I’m not getting the array loaded correctly.  The Clear Button exists, so we should be able to call the function through a script.

Long story short, does anyone have experience calling this function?  My javascript abilities are not up to par to dig through the CPM.js and find the smoking gun.

Thank you,

Joel T

All Comments
Sort by:  Most Recent
Jan 28, 2021
Jan 28, 2021

Joel,

If you copied the above code and pasted it – you may need to simply delete and retype the quotes around  “hidden”.

Like
()
(2)
Jan 28, 2021
Jan 28, 2021
>
Greg Stager
's comment

And that was the solution!  Thank you for the quick response, Greg.

Like
(1)
Jan 28, 2021
Jan 28, 2021
>
Joel Taylor
's comment

Glad to hear it worked for you.

Like
()
Jan 28, 2021
Jan 28, 2021

Hi Greg,

Thank you for the quick answer!

I tried the code on slide entry, and as a button click. Neither worked.  I did put a semicolon after the last line (!1) as well just in case that played a role. I’ll play around with it some more.

Joel T

 

Like
()
Jan 28, 2021
Jan 28, 2021

If you simply want the TOC cleared when entering a slide, try placing this code in an Execute JavaScript onEnter Action

for (var a = 0; a < tocContent.parentObj.tocEntries.length; ++a) {
var b = tocContent.parentObj.tocEntries[a];
cp.toc.tocPersistanceManager.clearVisited(b);
b.visitedDiv && (b.visitedDiv.style.visibility = “hidden”);
b.entryContainer.visited = !1
}

Like
(2)