Skip to main content
Known Participant
January 21, 2015
Question

Scrolling the TOC on an iPad

  • January 21, 2015
  • 1 reply
  • 439 views

Is it still impossible to scroll the TOC on an iPad in CP8 due to iFrame issues in Safari?

This topic has been closed for replies.

1 reply

Known Participant
February 6, 2015

No It's not impossible.

I don't know what the IFrame issues were, but I took a look at the current javascript code in CPM.js this evening. It appears as though the captivate developers thought users would scroll the TOC using multiple fingers. If you scroll with a few fingers there's a decent chance it will work without a slide getting unintentionally launched.

Do you demand a better user experience than a multi-finger scrolling requirement can offer? Well I think there might be a relatively simple fix for that.

When the user touches a TOC element a function is associated with the start and end of that touch. Why not add in a function for scrolling too? There's probably a simpler way, but this is what I did and on a quick test it seems to work with ipad.

I added the part in bold:

if (cp.device == cp.IDEVICE || cp.device == cp.ANDROID) a.ontouchstart = this.checkIfMultitouch, a.ontouchmove = this.recordMove, a.ontouchend = this.navigate;

You then need to define the function between the other two functions. All it will do it set a variable if there was scrolling. Then you need to add a check in the existing 'navigate' function to check if the variable is true before sending the command to navigate to a new slide, as well as switching the variable back to false now that scrolling is done. Parts in bold are the additions:

,

    recordMove: function(b) {

  

        cp.toc.moved = 1;

    },

    navigate: function(b) {

        if (!0 != cp.toc.multitouched && !0 != cp.toc.moved)

            if (b.changedTouches && b.changedTouches[0].pageX - cp.toc.startPosition >

                b.target.clientHeight) cp.toc.startPosition = b.target.clientHeight;

            else {

                if (this.parentObj.hasChild)

                    if (cp.toc.isSearchMode) {

                        if (!cp.toc.movieProperties.tocProperties.enableNavigation) return;

                        for (var a, b = this.parentObj.index + 1; b < this.parentObj.contentDiv.tocEntries.length && !(this.parentObj.contentDiv.tocEntries.level <= this.level); ++b)

                            if (void 0 != this.parentObj.contentDiv.tocEntries.link) {

                                a = this.parentObj.contentDiv.tocEntries.link;

                                break

                            }

                        a && (cp.toc.movieProperties.tocProperties.navigateVisited &&

                            this.parentObj.entryContainer.visited || !cp.toc.movieProperties.tocProperties.navigateVisited) && cp.jumpToSlide(a)

                    } else this.parentObj.entryContainer.expanded = !this.parentObj.entryContainer.expanded, this.parentObj.showHideChildren(this.parentObj.entryContainer.expanded, !0), this.parentObj.contentDiv.parentObj.updateTOCEntries();

                    else if (this.parentObj.link && cp.toc.movieProperties.tocProperties.enableNavigation && (cp.toc.movieProperties.tocProperties.navigateVisited && this.parentObj.entryContainer.visited || !cp.toc.movieProperties.tocProperties.navigateVisited)) cpLockTOC || cp.jumpToSlide(this.parentObj.link);

                cp.responsive && 480 >= window.innerWidth && cp.toc.tocAnimator.hideTOC()

            }

          cp.toc.moved = 0;

    },

Anyone know what the best practice is for having customization to CPM.js automatically included in all the projects I publish?

Inspiring
February 6, 2015

I think trying to automate changes to CPM.js is a risky proposal as it is regenerated at each output.

Better to add custom changes to the HTML template file in the program folder so it is always there in the output.

For example, C:\Program Files\Adobe\Adobe Captivate 8 x64\HTML/index.html.