open-lms-open-source / moodle-theme_snap

GNU General Public License v3.0
79 stars 75 forks source link

H5P 'Book' activity not working when embedded #215

Open sampash opened 3 years ago

sampash commented 3 years ago

When clicking through on any part of the embedded book activity, the entirety of the content in the section disappears.

image

Console error:

Uncaught Error: Syntax error, unrecognized expression: #h5pbookid=1189
    at Function.se.error (jquery-3.5.1.min.js:2)
    at se.tokenize (jquery-3.5.1.min.js:2)
    at se.select (jquery-3.5.1.min.js:2)
    at Function.se [as find] (jquery-3.5.1.min.js:2)
    at S.fn.init.find (jquery-3.5.1.min.js:2)
    at new S.fn.init (jquery-3.5.1.min.js:2)
    at S (jquery-3.5.1.min.js:2)
    at Object.showSection (course-lazy.js:1)
    at first.js:505
    at dispatch (jquery-3.5.1.min.js:2)
Julian-Tovar commented 1 year ago

Hi @sampash I'm so sorry this took so long to fix. The problem was that Snap generates a scroll to section location using jQuery, but #h5pbookid=num1 is an invalid jQuery selector, because it contains an equal sign =. The solution was to allow H5P to decide for themselves how to handle the navigation within its iframe, without interference from Snap. The fix should be available soon (it's only pending review).