Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set of inline elements #2

Open
snillo opened this issue Jul 8, 2011 · 1 comment
Open

set of inline elements #2

snillo opened this issue Jul 8, 2011 · 1 comment

Comments

@snillo
Copy link

snillo commented Jul 8, 2011

Hi,

i use mediabox to display a set of "inline" elements.
After closing the mediabox following code gets executed in function close()

    if (mediaType == "inline" && !options.inlineClone) {
        preload.adopt(image.getChildren()); // prevents loss of adopted data
    }

As far as i understood when opening the inline elment in the lightbox, Mediabox will MOVE the original inline html in to the lightbox. Thus the original placeholder gets emptied. After closing the Mediabox the moved inline html is injected in original placeholder again. The code above will do that.
Anyway, when using a set of inline elements, after clicking on "next" or "prev" the moved html will not be reinjected --> the HTML get lost and next time opening the lightbox will result in a black box without content... So i think the code from above has to be in function next() and function previous() too. At least this is working for me.

Notes: I'm using v. 1.4.5 ... same behaviour with v. 1.5.4 .. inlineClone is set to false (default option, when setting to true i get a JS error)

Btw. i want to say thanks for this GREAT lightbox. I tested a lot of lightboxes but this one is the best, really really flexible. Thank you :)

@iaian7
Copy link
Owner

iaian7 commented Jul 24, 2011

Whoops, looks like I left some work half-finished...I spent a long weekend a couple months ago trying to figure out how to clone elements with attached events (utterly failed, Mootools does NOT make it easy - it looked like I'd have to do it on an individual element basis), then trying to remove/move/replace elements without losing the data (also failed, inexplicably - I have no idea why mediaboxAdvanced kept losing stuff that I was explicitly not allowing it to lose). All that to say, I think I left some of the failed code behind. Until the core can be reworked with a fully-modern structure (several people have offered to help on the Google Groups, but I'm still waiting on feedback), it'll probably need to default to the old style (clone, not move). It may not be working correctly right now, will have to take a look. Sorry about that! It may be a bit before I have a chance to review. :(

Iaian7 / John Einselen

On Jul 8, 2011, at 11:43 AM, snillo wrote:

Hi,

i use mediabox to display a set of "inline" elements.
After closing the mediabox following code gets executed in function close()

  if (mediaType == "inline" && !options.inlineClone) {
      preload.adopt(image.getChildren()); // prevents loss of adopted data
  }

As far as i understood when opening the inline elment in the lightbox, Mediabox will MOVE the original inline html in to the lightbox. Thus the original placeholder gets emptied. After closing the Mediabox the moved inline html is injected in original placeholder again. The code above will do that.
Anyway, when using a set of inline elements, after clicking on "next" or "prev" the moved html will not be reinjected --> the HTML get lost and next time opening the lightbox will result in a black box without content... So i think the code from above has to be in function next() and function previous() too. At least this is working for me.

Notes: I'm using v. 1.4.5 ... same behaviour with v. 1.5.4 .. inlineClone is set to false (default option, when setting to true i get a JS error)

Btw. i want to say thanks for this GREAT lightbox. I tested a lot of lightboxes but this one is the best, really really flexible. Thank you :)

Reply to this email directly or view it on GitHub:
#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants