This bug follows #294361: Lightbox support for Drupal messages..

I use lightbox2 to display drupal error messages. All is ok, but I want a button on which my users can click to see again what was the messages.

So, I did:

  <?php if ($show_messages && $messages): ?>
    <div class="there_is_messages_link" onclick="$('.drupal-messages-box').triggerHandler('click');">
      <span><?php print t('There is some messages (click to see)'); ?></span>
    </div>
    <div id="lightboxAutoModal" class="drupal-messages-box" style="display: none;" >
      <?php print $messages; ?>
    </div>
  <?php endif; ?>

The problem here is when I try to click on my link, it displays an empty box.

I fixed the problem doing this:

  end: function(caller) {
   ...
    if (Lightbox.isSlideshow) {
      for (var i = 0; i < Lightbox.slideIdCount; i++) {
        window.clearTimeout(Lightbox.slideIdArray[i]);
      }
      $('#lightshowPause, #lightshowPlay').hide();
    }
    else if (Lightbox.isLightframe) {
      $('#frameContainer').empty().hide();
    }
    else if (Lightbox.isVideo) {
      $('#modalContainer').hide().html("");
    }
    else if (Lightbox.isModal) {
      $('#modalContainer').hide();
    }
  },

The problem here is I think doing this I break the behavior of lightbox. I noticed that:

  • The fact the #lightboxautomodal is an id makes it a singleton we can use only once on the html page. If this is a wanted thing, so, why does the lightbox default behavior is to erase data which stays inside the lightbox on close?
  • And, beside this note, why does the lightbox 'erase' my original div's content when it displays it in the lightbox? This content shouldn't be kept at it's original place so we can print it again with ligthbox?

Comments

pounard’s picture

I think all this project's mainteners are dead!

stella’s picture

Status: Active » Fixed

Fixed, though with a small change. Thanks! Will be included in the next dev release.

pounard’s picture

Nice, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.