cgkineo / adapt-pageNav

Navigation bar component (quicknav clone)
GNU General Public License v3.0
6 stars 4 forks source link

Close function should call LMS close function #26

Closed simondate closed 1 year ago

simondate commented 2 years ago

The Close extension attempts to call the function scormWrapperInstance.finish(); before calling top.window.close();

This extension just calls top.window.close();, without anything else. Why don't we copy that code snippet to this extension?

oliverfoster commented 2 years ago

Is there a reason for this pr?

simondate commented 2 years ago

If a learner is in an LMS that uses frameset for SCORM content then top.window.close() alone won't exit the course. The other Adapt plugin that uses this function, adapt-close, uses this additional fallback.

simondate commented 2 years ago

I've tested this PR and it doesn't seem to be working currently.

It seems the single quotation marks remove the context so it fires from the window context meaning you can't invoke any functions.

If you remove the single quotation marks around the function it is invoked immediately.

I've tried placing it inside an anonymous function but that leads to errors too. For example

_close: new Backbone.Model({ _id: '', _onClick: () => {console.log('hi')} }) leads to this error

image

@oliverfoster if you have a few minutes could you recommend what to add here

oliverfoster commented 2 years ago

try https://github.com/cgkineo/adapt-pageNav/pull/29

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 2.2.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: