The attachBehaviors method from the javascript Drupal object should only be called on page load and for new content loaded with ajax. However, the cbox_complete event handler from colorbox does call the attachBehaviors method for all content, also for inline content that was already on the page. IMO it should do so only for new content, not already existing inline content.

Note 1: I had a look if I could read the settings (and check for inline: $.colorbox.settings.inline) in the event handler but it looks like that always returns (boolean) false, so I'm not sure how to solve this.

Note 2: I think the code in colorbox-inline.js should convert the value of $.urlParam for inline and iframe to a boolean. Now the settings contain a string "true" or "false" that both evaluate to (boolean) true.

Comments

frjo’s picture

Status: Active » Postponed (maintainer needs more info)

You are right I believe, provide a clean looking patch and I will test and commit it.

fietserwin’s picture

Not sure, if this will be solved by the solution of #1933956: Behaviors Attach and cbox_complete , but I will try to test.

fietserwin’s picture

Unfortunately, it is not solved by the patch from the other issue. However, the problems I had with it were solved in my own module, so I guess that this becomes rather minor.

bcobin’s picture

I'm not sure if this is the same issue, but colorbox is automatically turning images into links where it shouldn't, such as page header images I'm creating using a views header. I don't remember seeing this behavior in the past - it persists with the latest dev version.

Emergency workaround is to link the image to the page so that the colorbox doesn't open, but this is just wrong.

Any ideas? Thanks much!

frjo’s picture

@bcobin that is a very different problem from this. Please open a new issue.

bcobin’s picture

Done. See https://drupal.org/node/2243447. Thank you!

frjo’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)