Feat back

Merged
#13 · Created  · Last updated

Merged pull request

Merged in danmichaelo/ximpel/feat-back (pull request #13)

c9a89b0·Author: ·Closed by: ·2018-07-06

Description

Adds

  • support for navigation using the browser’s back/forward buttons and for linking to a specific subject.

  • “back()” as a special subject id that calls window.history.back().

Includes a workaround for the following issue:

Say you have a subject A that leads to subject B. Subject B has an iframe in it, showing page home.html, but allowing you to navigate to hello.html. Since the navigation happens within the iframe, the subject id is still the same (B). Pressing the browser back button (or using window.history.back()) once will take the iframe back from hello.html to home.html. Pressing it another time will take you back from subject B to subject A.

But because of the use of onOneClick in ximpel.MediaPlayer.prototype.updateOverlays, a button with leadsTo="back()" will only work once, taking you from hello.html to home.html. Pressing it a second time will not work, so you don't get back from B to A.

Replacing overlayView.onOneClick with overlayView.onClick solves this problem, but that might have other unintended consequences, so instead we re-attach the click handler only if the target is “back()”. There might be a more elegant way to fix this though.

0 attachments

0 comments

Loading commits...