Skip to main content

BackLinkController

Purpose

A controller to enable a link to navigate back 1 page using the user's browser history. Falls back to the href of the link if there is no history available or the operation fails.

Actions

ActionPurpose
--

Targets

TargetPurposeDefault
---

Classes

ClassPurposeDefault
---

Values

ValueTypeDescriptionDefault
timeoutNumberThe delay in ms before the controller should give up on history navigation and fall back to navigating to the link's href1500
pagesNumberThe number of entries in the browser history to navigate back by1

Events

EventWhenDispatched onevent.detail
----

Side Effects

  • Adds event listeners to the attached element for click
  • When a click occurs, if there is an href present on the link: sets a setTimeout for timeoutValue milliseconds so that if navigation fails, the page will instead navigate to the href of the link.

How to Use