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

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

5 Comments
2021-01-28 14:36:46
2021-01-28 14:36:46

Joel,

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

Like
(2)
>
Greg Stager
's comment
2021-01-28 14:41:51
2021-01-28 14:41:51
>
Greg Stager
's comment

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

Like
(1)
>
Joel Taylor
's comment
2021-01-28 14:43:48
2021-01-28 14:43:48
>
Joel Taylor
's comment

Glad to hear it worked for you.

Like
2021-01-28 14:33:21
2021-01-28 14:33:21

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
2021-01-28 13:49:49
2021-01-28 13:49:49

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)
Add Comment