Fix issue #3128: Enable prev/next AJAX functionality in reveal

- An AJAX reveal modal trying to open itself with a different URL does not work with the current code:
  the code checks if the modal is already open, and does nothing if the modal is open because it assumes
  that the content of a modal is static. This is not the case for AJAX modals, where the same container
  could be used to display dynamic content.

  This fix deals differently with the check of whether the reveal modal is open or not: in case of an
  AJAX modal, it will simply load the new content inside the same modal without animating it again.