Skip to content

Change page url according to modals opening and closing.

Notifications You must be signed in to change notification settings

fourlabsldn/fl-modal-router

Repository files navigation

fl-modal-router

Build Status

The goals of the modal router are:

  • back button to dismiss modal
  • forward button to reopen modal
  • back to modal with back button if closed modal pressing 'x'
  • no modal load from URL

Decision point:

If I am on a page and I

  • 1 ) open a modal
  • 2 ) close a modal
  • 3 ) refresh the page

What should the back buton do?

  • Go to the modal URL refreshing the page, as we cannot assume that the modal content is setup, or even that it exists after the refresh.
  • Assume the modal content is there and try to open it
  • Try to open it, if it doesn't work, then refresh it.

The approach we are taking here is to assume the least possible, so we perform a full refresh.

Development

npm run dev

Demo

npm run demo

About

Change page url according to modals opening and closing.

Resources

Stars

Watchers

Forks

Packages

No packages published